Skip to content

Instantly share code, notes, and snippets.

View ElijahLynn's full-sized avatar
😎
All Your DevOps Belong To Us

Elijah Lynn ElijahLynn

😎
All Your DevOps Belong To Us
View GitHub Profile
// No directories with --follow.
git log -M --follow <filename>
@ElijahLynn
ElijahLynn / gist:1506df053c2677f08301
Last active August 29, 2015 14:11
Scroll up for history on IRCCloud
// http://stackoverflow.com/a/2133217/292408
function scrollToTop() {
$( "div.scroll" ).scrollTop( -10000 )
}
setInterval( scrollToTop, 1000 );
// clearInterval(tid);
@ElijahLynn
ElijahLynn / cs-gmaps-directions
Created October 16, 2014 19:04
Google Maps Directions Chrome Search Engine
// http://jonthegeek.blogspot.be/2009/07/multi-parameter-firefox-keywords-and.html
javascript:
var s='%s';
url='http://maps.google.com/maps?saddr=%s&daddr=%s';
query='';
urlchunks=url.split('%s');
schunks=s.split(';');
for(i=0; i<schunks.length; i++)query+=urlchunks[i]+schunks[i];
location.replace(query);
@ElijahLynn
ElijahLynn / ubuntu-14.04-setup
Last active August 29, 2015 14:04
Stuff I do to a new install of Ubuntu 14.04
System Load Indicator - https://launchpad.net/indicator-multiload
cp -p /etc/hosts
cp -p /etc/apache2/sites-available
Chrome
Inkscape
Composer Global
Drush via Composer
PhpStorm + Codesniffer & Drupal Coder rules via Composer
Insync
Tmux
#!/bin/bash
# https://gist.github.com/gregferrell/747642
if [[ $1 ]];
then
php -r " echo var_dump(unserialize('"$1"')); echo \"\\n\";"
else
STRING=`pbpaste`
php -r " echo var_dump(unserialize('"$STRING"')); echo \"\\n\";"
fi
function throttle( fn, time ) {
var t = 0;
return function() {
var args = arguments, ctx = this;
clearTimeout(t);
t = setTimeout( function() {
fn.apply( ctx, args );
}, time );
};
@ElijahLynn
ElijahLynn / new_gist_file_0
Created November 25, 2013 21:20
Run Drupal Simpletests from Drush and avoid permission errors by running as www-data (the server) and also preserve environment variables (-E). Preserving environment variables is really only needed when you enable xdebug on the command line.
sudo -E -u www-data drush @pub7.local test-run ActionsConfigurationTestCase --uri=loc.example.com
@ElijahLynn
ElijahLynn / SassMeister-input-HTML.html
Created November 14, 2013 22:03 — forked from Snugug/SassMeister-input-HTML.html
Generated by SassMeister.com.
<div class="crosshair"></div>
@ElijahLynn
ElijahLynn / new_gist_file
Created September 19, 2013 15:46
Pub7 Tag Instructions
open new hotfix branch off of tag
merge branch into master
tag the branch SPECIAL
* cd into root of clone
* ./builds/scripts/pub-tag.sh 7.23.1 (example, don't use v prefix, script does it for us)
* ./builds/scripts/pub-tag2.sh
* git checkout master --force
* ./builds/scripts/pub-tag3.sh
NOTE: If pub-tag2.sh and pub-tag3.sh don't work or you get confused that is okay. pub-tag.sh is the one that really does the tag but contact Sam Boyer and let him know about it. If all you can ever do is the first script, that is fine.
@ElijahLynn
ElijahLynn / battery
Created September 11, 2013 16:46
Battery info Manually forked from https://github.com/richoH/dotfiles/blob/master/bin/battery Place in your ~/bin folder and now the command 'battery' will show you your battery percentage in Ubuntu. I have this set to always display in my Tmux pane with set -g status-right "#(~/bin/battery) | #[fg=cyan]%d %b %R" Modified so when charging it will…
#!/bin/sh
HEART_FULL=♥
HEART_EMPTY=♡
[ -z "$NUM_HEARTS" ] &&
NUM_HEARTS=5
cutinate()
{
perc=$1