Skip to content

Instantly share code, notes, and snippets.

@idleberg
idleberg / vscode-macos-context-menu.md
Last active April 19, 2024 02:28
“Open in Visual Studio Code” in macOS context-menu

Open in Visual Studio Code

  • Open Automator
  • Create a new document
  • Select Quick Action
  • Set “Service receives selected” to files or folders in any application
  • Add a Run Shell Script action
    • your default shell should already be selected, otherwise use /bin/zsh for macOS 10.15 (”Catalina”) or later
    • older versions of macOS use /bin/bash
  • if you're using something else, you probably know what to do 😉
@scriptdev
scriptdev / .php
Last active April 19, 2024 02:27
OCULTAR COLUNA DO DATAGRID DETAILFORM
<?php
# SEM O CLASS
TScript::create("$('table th:contains(\"TITULO DA COLUNA\")').hide();");
# COM O CLASS
TScript::create("$('table th.tdatagrid_col:contains(\"TITULO DA COLUNA\")').hide();");
# "tdatagrid_col" É O NOME DO class
# "TITULO DA COLUNA" É O NOME DO TÍTULO DA COLUNA
@scriptdev
scriptdev / .php
Created November 4, 2023 13:43
VERIFICAR SE OS DADOS DO SMTP DO E-MAIL FOI PREENCHIDOS EM PREFERÊNCIAS
<?php
TTransaction::open(self::$database);
$preferences = SystemPreference::getAllPreferences();
$mail_from = $preferences['mail_from'];
$host = $preferences['smtp_host'];
if (!empty($mail_from) and !empty($host))
@irisTa56
irisTa56 / ipyvolume_gc.py
Last active April 19, 2024 02:26
Visualize a Gaussian Cube file by IPyVolume.
import ipyvolume.pylab as p3
import numpy as np
element_list = [
"H", "He", "Li", "Be", "B", "C", "N", "O", "F", "Ne",
"Na", "Mg", "Al", "Si", "P", "S", "Cl", "Ar", "K", "Ca"
]
class IPyVolume_GC:
"""
@nepsilon
nepsilon / git-change-commit-messages.md
Last active April 19, 2024 02:23
How to change your commit messages in Git? — First published in fullweb.io issue #55

How to change your commit messages in Git?

At some point you’ll find yourself in a situation where you need edit a commit message. That commit might already be pushed or not, be the most recent or burried below 10 other commits, but fear not, git has your back 🙂.

Not pushed + most recent commit:

git commit --amend

This will open your $EDITOR and let you change the message. Continue with your usual git push origin master.

@actuino
actuino / bt_speaker-raspberry_pi-zero_w.md
Last active April 19, 2024 02:22
Setting up a Bluetooth Speaker from the command line on a raspberry Pi Zero W

The setup of a bluetooth speaker on a Pi Zero W is pretty touchy.

Please get in touch via Twitter @actuino or http://www.actuino.fr/ if you've got comments or improvements to this quick draft.

First checks

  • Use a solid power source
  • check the speaker works on another hardware (android phone f.i.)
  • make sure you've updated your Raspbian, install and run rpi-update just in case.
@adrianhorning08
adrianhorning08 / index.js
Last active April 19, 2024 02:22
Scraping Linkedin Search Results
// copy into a file called linkedinScrape.js (or whatever you want to call it) then call node linkedinScrape.js
const cookies = "" // your cookies
const page = 1
const searchTerm = "marketing agency"
const results = await searchLinkedIn(searchTerm, page)
console.log(results)
export async function searchLinkedIn(query, page = 1) {
try {
@mandiwise
mandiwise / Count lines in Git repo
Last active April 19, 2024 02:22
A command to calculate lines of code in all tracked files in a Git repo
// Reference: http://stackoverflow.com/questions/4822471/count-number-of-lines-in-a-git-repository
$ git ls-files | xargs wc -l
@danielwetan
danielwetan / nodejs-cicd-github-actions.md
Last active April 19, 2024 02:19
Deploy Node.js to VPS using Github Actions

Deploy Node.js to VPS using Github Actions

Steps to deploy Node.js to VPS using PM2 and Github Actions

1. Clone repo to VPS folder

@rumansaleem
rumansaleem / clean-up-arch-linux.md
Created May 28, 2019 08:51
Instructions to clean up Arch Linux (Manjaro)

Contents

  • Clean pkg cache
  • Remove unused packages (orphans)
  • Clean cache in /home
  • remove old config files
  • Find and Remove
    • duplicates
    • empty files
    • empty directories
  • broken symlinks