Skip to content

Instantly share code, notes, and snippets.

View lsaffie's full-sized avatar

Luis Saffie lsaffie

View GitHub Profile
@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
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 / gist:e4c303adf60c0e7b1f12
Last active August 29, 2015 14:11
EC2 instance - ubuntu
#Make sure github is trusted prior to running this
# ssh github.com
#Usage wget --no-check-certificate -O - https://gist.github.com/lsaffie/5259be3fd24008ebb7db/raw/hsdevbox |bash
apt-get update
echo "base packages"
@lsaffie
lsaffie / hsdevbox
Last active August 29, 2015 14:07
build hsdevbox
#Make sure github is trusted prior to running this
# ssh github.com
#Usage wget --no-check-certificate -O - https://gist.github.com/lsaffie/5259be3fd24008ebb7db/raw/hsdevbox |bash
#using dotdeb
echo 'deb http://packages.dotdeb.org wheezy all' | sudo tee --append /etc/apt/sources.list
echo 'deb-src http://packages.dotdeb.org wheezy all' | sudo tee --append /etc/apt/sources.list
sudo apt-get update
@lsaffie
lsaffie / gist:3ed8cb57f2446482661d
Last active August 29, 2015 14:06
upgrade vm to Wheezy and install mysql 5.6
#Let's back up just in case
sudo mv /var/lib/mysql /var/lib/mysql-saved
#replace your /etc/apt/sources.list with the lines below: (beetween BEGIN/END)
#---BEGIN
deb http://ftp.us.debian.org/debian/ wheezy main
deb-src http://ftp.us.debian.org/debian/ wheezy main
deb http://security.debian.org/ wheezy/updates main
deb-src http://security.debian.org/ wheezy/updates main