Skip to content

Instantly share code, notes, and snippets.

# Echo number of GIT commits per year.
git log --pretty='format:%cd' --date=format:'%Y' | uniq -c | awk '{print "Year: "$2", commits: "$1}'
@GetVladimir
GetVladimir / Force-RGB-Color-on-M1-Mac.md
Last active March 28, 2024 18:57
Force RGB Color on M1 Mac

Force RGB Color on M1 Mac

How to Force RGB Color Output instead of YPbPr on your M1 Apple Silicon Mac for an External Monitor.

This step-by-step video tutorial will guide you through the procedure of forcing RGB color output on your M1 Mac.

Force RGB Color on M1 Mac

Here is the direct link to the video tutorial: https://www.youtube.com/watch?v=Z1EqH3fd0V4

The video also has Closed Captions (Subtitles) that you can enable, to make it easier to follow if needed.

@OrionReed
OrionReed / DOM3D.js
Last active March 28, 2024 18:57
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@xixiaofinland
xixiaofinland / sfdx-cheatsheet.sh
Last active March 28, 2024 18:54
Salesforce SFDX Cheat Sheet
# Proudly supplied by Salesforce Way Site: https://salesforceway.com
# This cheatsheet contains the most often used SFDX commands for beginners to get a jumpstart.
# Hint. it is highly recommended to use `-h` to check the usage of any SFDX commands and corresponding parameters.
# For instance, use `sfdx force:auth:web:login -h` to checke what `-d` `-a` parameters do
# List down all supported dx commands:
sfdx force:doc:commands:list
# Check current DebHub and Scratch Org status
sfdx force:org:list
@bittercoder
bittercoder / convert.sh
Last active March 28, 2024 18:54
Convert .heic files to .jpg on linux (coming from an iOS11 device over USB)
# download release from github: https://github.com/monostream/tifig/releases and install at ~/tools/tifig
# then run these commands in the folder (just to keep things simple we normalize the file extension case before proceeding).
for f in *.HEIC; do mv "$f" "`echo $f | sed s/.HEIC/.heic/`"; done
for file in *.heic; do echo "~/tools/tifig -v -p $file ${file/%.heic/.jpg}"; done
@RuolinZheng08
RuolinZheng08 / backtracking_template.py
Last active March 28, 2024 18:48
[Algo] Backtracking Template & N-Queens Solution
def is_valid_state(state):
# check if it is a valid solution
return True
def get_candidates(state):
return []
def search(state, solutions):
if is_valid_state(state):
solutions.append(state.copy())
@sloanlance
sloanlance / Editing remote files in Vim with SSH.md
Created July 13, 2017 16:11
Editing remote files in Vim with SSH

Editing remote files in Vim with SSH

  1. Configure SSH

    In ~/.ssh/config, include the lines:

    Host *
    ControlPath ~/.ssh/sockets/%r@%h-%p
    
@mick-io
mick-io / street-suffix-abbreviations.json
Last active March 28, 2024 18:47
C1 Street Suffix Abbreviations from USPS. The keys represent the USPS standard abbreviations, the arrays contain primary and commonly used suffixes and abbreviations.
{
"ALY": [
"ALLEY",
"ALLEE",
"ALLY"
],
"ANX": [
"ANEX",
"ANNEX",
"ANNX"
@ozbillwang
ozbillwang / kubernetes-auto-completion-fish.md
Last active March 28, 2024 18:46
Kubernetes auto-completion works with FISH (better than Bash)