Skip to content

Instantly share code, notes, and snippets.

Avatar

Luis Saffie lsaffie

View GitHub Profile
@lsaffie
lsaffie / set-all-chrome-windows-to-first.scpt
Created Jun 4, 2019
Cycle through All Chrome windows and activate the first tab
View set-all-chrome-windows-to-first.scpt
tell application "/Applications/Google Chrome.app"
repeat with w in windows
set active tab index of w to 1
end repeat
end tell
View desk js
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,
View Tmux cheatsheet.md
View Tmux cheatsheet.md
View Tmux cheatsheet.md
View 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 Nov 4, 2016
git hook: appends branch name on every commit
View prepare-commit-msg
#!/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 Aug 29, 2015
EC2 instance - ubuntu
View gist:e4c303adf60c0e7b1f12
#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 Aug 29, 2015
build hsdevbox
View 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 Aug 29, 2015
upgrade vm to Wheezy and install mysql 5.6
View gist:3ed8cb57f2446482661d
#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
You can’t perform that action at this time.