Skip to content

Instantly share code, notes, and snippets.

@dayfuaim
dayfuaim / git_files
Last active February 15, 2017 14:00
Get all files created/changed in the BRANCH
#!/bin/bash
#
# Usage: git_files <BRANCH>
#
# Get all files created/changed in the BRANCH
#
git diff --stat `git merge-base master $1`..$1
@Jamesits
Jamesits / MacType-James.ini
Last active May 16, 2025 14:42
My MacType profile, optimized for Telegram UWP and something else.
; Please see https://gist.github.com/Jamesits/6a58a1b08d5cd09a94a02f30ddaf0e13#gistcomment-2081294
; for instruction.
; Author: James Swineson <[email protected]>
[General]
Name=James Profile
; 【启用 DirectWrite 支持】
; [0:Disable] 1:Enable
DirectWrite=1
@jkbockstael
jkbockstael / AlbumsOrder.scpt
Created October 25, 2017 12:43
AppleScript to get iTunes to sort albums by release date
-- Fix albums display order
-- Changes the "sort album" field, to ensure that albums get displayed in chronological order on iPods.
-- CC-BY-NC 2011, Jean-Karim Bockstael,
tell application "iTunes"
-- input checking
if selection is {} then
display dialog "You must select at least a track"
return
else
set selected_tracks to selection
@m-radzikowski
m-radzikowski / script-template.sh
Last active May 22, 2025 17:41
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@broofa
broofa / checkForUndefinedCSSClasses.js
Last active June 22, 2025 08:19
ES module for detecting undefined CSS classes (uses mutation observer to monitor DOM changes). `console.warn()`s undefined classes.
/**
* Sets up a DOM MutationObserver that watches for elements using undefined CSS
* class names. Performance should be pretty good, but it's probably best to
* avoid using this in production.
*
* Usage:
*
* import cssCheck from './checkForUndefinedCSSClasses.js'
*
* // Call before DOM renders (e.g. in <HEAD> or prior to React.render())