Skip to content

Instantly share code, notes, and snippets.

View lsaffie's full-sized avatar

Luis Saffie lsaffie

View GitHub Profile
@lsaffie
lsaffie / pre-commit
Created August 5, 2012 20:00
pre-commit git hook that checks for values in the FORBIDDEN array
#!/bin/bash
# Pre commit hook that prevents FORBIDDEN code from being commited.
# Add unwanted code to the FORBIDDEN array as necessary
FILES_PATTERN='\.(rb|js|coffee)(\..+)?$'
FORBIDDEN=( debugger ruby-debug )
for i in "${FORBIDDEN[@]}"
do
@lsaffie
lsaffie / set-all-chrome-windows-to-first.scpt
Created June 4, 2019 19:53
Cycle through All Chrome windows and activate the first tab
tell application "/Applications/Google Chrome.app"
repeat with w in windows
set active tab index of w to 1
end repeat
end tell
@lsaffie
lsaffie / open-tmux-shared
Last active April 3, 2019 16:24
opens a tmux session with four windows and 4 splits each
# opens 4 windows with 4 panels each using a shared socket
#@params [exit value, default path]
open_panels () {
if [ $1 -eq 0 ]; then
tmux -S ~/.tmuxsocket set-option default-path $2
tmux -S ~/.tmuxsocket source-file '/Users/lsaffie/.tmux/dev'
fi
}
var widget_embed_libraries_191_version = "1.0";
(function(window, document, $, undefined) {
var W = $(window),
D = $(document),
F = $.fancybox = function() {
F.open.apply(this, arguments)
},
IE = navigator.userAgent.match(/msie/),
didUpdate = null,
isTouch = document.createTouch !== undefined,
@lsaffie
lsaffie / Tmux cheatsheet.md
Created January 5, 2017 15:43
tmux-cheatsheet
%h1 Tmux cheatsheet
https://github.com/lsaffie/tmux
Prefix:
<pre><code>ctrl+a</code></pre>
Moving aroud:
right:
<pre><code>ctrl+a + l</code></pre>
@lsaffie
lsaffie / prepare-commit-msg
Last active November 4, 2016 21:25
git hook: appends branch name on every commit
#!/bin/bash
# Place this in <project_name>/.git/hooks/prepare-commit-msg
git branch | sed -n '/\* /s///p' >> $1
@lsaffie
lsaffie / Vagrantfile
Created December 18, 2013 01:41
Vagrantfile with public networking
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
#VM name
config.vm.box = "homestars-devbox-vagrant"