Skip to content

Instantly share code, notes, and snippets.

@broofa
broofa / checkForUndefinedCSSClasses.js
Last active January 21, 2024 17:22
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())
@m-radzikowski
m-radzikowski / script-template.sh
Last active November 15, 2024 11:25
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...]
@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
@Jamesits
Jamesits / MacType-James.ini
Last active March 27, 2023 10:15
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
@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
@pavelbinar
pavelbinar / extract-subtitles-from-mkv.md
Last active June 3, 2024 07:51 — forked from bmaeser/subtitle-extract.txt
Extract subtitles from .mkv files on Mac OS X
@AnwarShah
AnwarShah / gresource-extract
Created September 23, 2016 10:09
Gresource-extract. Original Credit goes to the author here http://projects.thecodergeek.com/scripts/gresource-extract
#!/bin/bash
##############################################################################
# Author: Peter Gordon <[email protected]>
# License: Public Domain
##############################################################################
# gresource-extract.sh
# Version: 1
#
# This Bash script is designed to extract all resource files in a given
# GResource file, with the given base folder. For example, if a GResource file
@kwcto
kwcto / mac-file-transfer-via-command-line.md
Created October 22, 2015 18:51
How to copy files / folders off a Mac from the command line (optionally using Single User Mode)
@tpai
tpai / instructions.md
Last active September 22, 2022 11:20
use both Tor and Privoxy with Mac OSX

1. install

brew install tor
brew install privoxy

2. copy and modify config file

@bennadel
bennadel / assign.less
Created June 5, 2014 16:02
Executing JavaScript In The LESS CSS Precompiler
@foo: `javascript` ;