Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
DevOps for VA.gov's CMS

Elijah Lynn ElijahLynn

💭
DevOps for VA.gov's CMS
View GitHub Profile
View amazons3.module
function amazons3_stream_wrappers() {
// This hook is called before hook_init(), so we have to manually register
// the autoloader. We also need to handle module upgrades where
// composer_manager might not be enabled yet.
if (!module_exists('composer_manager')) {
return array();
}
// If the module has been enabled, but the user didn't update composer
View php_unserialize.sh
#!/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
@ElijahLynn
ElijahLynn / ubuntu-14.04-setup
Last active Aug 29, 2015
Stuff I do to a new install of Ubuntu 14.04
View ubuntu-14.04-setup
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
@ElijahLynn
ElijahLynn / cs-gmaps-directions
Created Oct 16, 2014
Google Maps Directions Chrome Search Engine
View cs-gmaps-directions
// 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 / gist:1506df053c2677f08301
Last active Aug 29, 2015
Scroll up for history on IRCCloud
View gist:1506df053c2677f08301
// http://stackoverflow.com/a/2133217/292408
function scrollToTop() {
$( "div.scroll" ).scrollTop( -10000 )
}
setInterval( scrollToTop, 1000 );
// clearInterval(tid);
View gist:b1f3fda8d45b34395179
// No directories with --follow.
git log -M --follow <filename>
View NFS actimeo (vegrant, pubstack)
# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
dev.vm.synced_folder pubstack_config['synced_folder'], '/var/www/html',
type: synced_folder_type,
mount_options: ['rw', 'vers=3', 'tcp', 'fsc', 'actimeo=1']
View meetupWaitlistNumber
// Taken from comment by Eli Hellmann @ http://www.meetup.com/AngularJS-NYC/events/221056642
Array.prototype.reduce.call($('#rsvp-list-waitlist li'), function(agg,e,i){return agg || (/Elijah Lynn/i.test($(e).text()) ? i : agg);},null) //:)
View ckeditor-3.0.js
insert: function(content) {
content = this.prepareContent(content);
if (CKEDITOR.env.webkit || CKEDITOR.env.chrome || CKEDITOR.env.opera || CKEDITOR.env.safari) {
// Works around a WebKit bug which removes wrapper elements.
// @see https://drupal.org/node/1927968
var tmp = new CKEDITOR.dom.element('div'), children, skip = 0, item;
tmp.setHtml(content);
children = tmp.getChildren();
skip = 0;
while (children.count() > skip) {
View gist:d4aac79636d8712fc4e5
http://askubuntu.com/a/620985/11929
GIT_SSH_COMMAND="ssh -v"
git clone example