Skip to content

Instantly share code, notes, and snippets.

@broofa
broofa / checkForUndefinedCSSClasses.js
Last active May 4, 2022
ES module for detecting undefined CSS classes (uses mutation observer to monitor DOM changes). `console.warn()`s undefined classes.
View checkForUndefinedCSSClasses.js
/**
* 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 May 11, 2022
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
View script-template.sh
#!/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 Oct 25, 2017
AppleScript to get iTunes to sort albums by release date
View AlbumsOrder.scpt
-- 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 Jun 24, 2021
My MacType profile, optimized for Telegram UWP and something else.
View MacType-James.ini
; Please see https://gist.github.com/Jamesits/6a58a1b08d5cd09a94a02f30ddaf0e13#gistcomment-2081294
; for instruction.
; Author: James Swineson <mactype@public.swineson.me>
[General]
Name=James Profile
; 【启用 DirectWrite 支持】
; [0:Disable] 1:Enable
DirectWrite=1
@dayfuaim
dayfuaim / git_files
Last active Feb 15, 2017
Get all files created/changed in the BRANCH
View git_files
#!/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 / subtitle-extract.md
Last active May 12, 2022 — forked from bmaeser/subtitle-extract.txt
Extract subtitles from .mkv files on Mac OS X
View subtitle-extract.md

Extract Subtitles From .mkv

These instructions shall work on Mac OS X and Linux.

Install mkvtoolnix (Mac OS X)

Installation via Homebrew:

brew install mkvtoolnix
@AnwarShah
AnwarShah / gresource-extract
Created Sep 23, 2016
Gresource-extract. Original Credit goes to the author here http://projects.thecodergeek.com/scripts/gresource-extract
View gresource-extract
#!/bin/bash
##############################################################################
# Author: Peter Gordon <peter@thecodergeek.com>
# 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 Oct 22, 2015
How to copy files / folders off a Mac from the command line (optionally using Single User Mode)
View mac-file-transfer-via-command-line.md
@tpai
tpai / instructions.md
Last active Apr 28, 2022
use both Tor and Privoxy with Mac OSX
View instructions.md

1. install

brew install tor
brew install privoxy

2. copy and modify config file

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