Skip to content

Instantly share code, notes, and snippets.

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command

Open/Goto


  • super+t: go to file
  • super+ctrl+p: go to project
  • super+r: go to methods
@boton
boton / Change Font.sketchplugin
Last active January 3, 2016 11:59 — forked from bomberstudios/Change Font.sketchplugin
Change font family for all text layers in Sketch
// Change font (ctrl a)
var font_name,
select_one_textlayer = false;
function check_layer(layer){
log("Checking layer " + layer + " of klass: " + [layer class])
switch ([layer class]) {
case MSTextLayer:
log("Found text layer!")
layer.setFontPostscriptName(font_name);
/***
<button> reset
1. Remove default browser appearance for buttons.
2. Remove margins.
3. Remove borders for IE.
4. Normalize font and color not inherited by `button`.
5. Address `overflow` in IE
6. Normalize cursor style
7. Normalize line-height
8. Normalize text-align
@boton
boton / parse_dotenv.bash
Created April 4, 2018 00:00 — forked from judy2k/parse_dotenv.bash
Parse a .env (dotenv) file directly using BASH
# Pass the env-vars to MYCOMMAND
eval $(egrep -v '^#' .env | xargs) MYCOMMAND
# … or ...
# Export the vars in .env into your shell:
export $(egrep -v '^#' .env | xargs)
@boton
boton / git-fs-history
Created May 8, 2018 08:07 — forked from jackocnr/git-fs-history
Git filesize history (shell script)
#!/bin/sh
#
# list the given file's filesize next to each commit
# usage: git-fs-history path/to/file
#
if [ $# -ne 1 ]; then
echo "Error: invalid number of arguments."
exit 1
@boton
boton / encoding-video.md
Created May 16, 2018 09:40 — forked from glen-cheney/encoding-video.md
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@boton
boton / sass-map-collect-function.scss
Created October 4, 2018 11:40
Sass function to merge multiple maps - map-collect
//Map Collect function
// Since the builtin map-merge function in Sass only take 2 arguments, it can only merge 2 maps at a time.
// The map-collect function below allows you to combine multiple maps together in a cleaner way.
@function map-collect($maps...) {
$collection: ();
@each $map in $maps {
$collection: map-merge($collection, $map);
}

Uninstall brew package and dependencies

Remove package's dependencies (does not remove package):

brew deps [FORMULA] | xargs brew remove --ignore-dependencies

Remove package:

@boton
boton / brew_clean
Created December 12, 2018 13:49 — forked from cskeeters/brew_clean
#!/bin/bash
if [ "$#" -ne "1" ]; then
echo "Usage: $0 package_list"
exit 1
fi
cat $1 | xargs -I {} bash -c "echo {}; brew deps {}" | sort | uniq > /tmp/brew_keep
comm -23 <(brew list -1 | sort) <(cat /tmp/brew_keep) > /tmp/brew_rm
lines=$(cat /tmp/brew_rm | wc -l | sed -e 's/ //g')
@boton
boton / README.md
Created April 2, 2019 18:15 — forked from devinrhode2/README.md
How to Change Open Files Limit on OS X and macOS Sierra (10.8 - 10.12)

How to Change Open Files Limit on OS X and macOS

This text is the section about OS X Yosemite (which also works for macOS Sierra) from https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/#mac-os-x

The last time i visited this link it was dead (403), so I cloned it here from the latest snapshot in Archive.org's Wayback Machine https://web.archive.org/web/20170523131633/https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/

Mac OS X

To check the current limits on your Mac OS X system, run: