Skip to content

Instantly share code, notes, and snippets.

@tiltedlistener
tiltedlistener / gist:12e878cc63140391ca1e
Created November 5, 2014 01:11
Drupal permissions for install on ubuntu
chmod a+w sites/default/settings.php
chmod a+w sites/default
# From https://www.digitalocean.com/community/tutorials/how-to-install-drupal-on-a-virtual-server-running-ubuntu-12-04
docker tag <image> <newName>/<repoName>:<tagName>
git branch -D <name-of-branch>
git branch -D -r origin/<name-of-branch>
git push origin :<name-of-branch>'
# http://stackoverflow.com/questions/2003505/how-to-delete-a-git-branch-both-locally-and-remotely
[[ -s "/usr/local/rvm/scripts/rvm" ]] && source "/usr/local/rvm/scripts/rvm";
@tiltedlistener
tiltedlistener / gist:72c8d61fd199ca83921f
Created August 5, 2014 06:44
Center a JFrame within a screen
Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
this.setLocation(dim.width/2-this.getSize().width/2, dim.height/2-this.getSize().height/2);
@tiltedlistener
tiltedlistener / gist:5c692625eb508397c402
Created August 5, 2014 05:49
BASH to remove all .DS_Stores
find . -name .DS_Store -print0 | xargs -0 git rm --ignore-unmatch
# http://stackoverflow.com/questions/107701/how-can-i-remove-ds-store-files-from-a-git-repository
@tiltedlistener
tiltedlistener / gist:279431807565618407f8
Created July 30, 2014 20:28
Basic cURL for PHP to hit a webhook
$ch = curl_init("HTTP://SOMEURL.com");
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt( $ch, CURLOPT_HEADER, 0);
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt( $ch, CURLOPT_TIMEOUT_MS, 10000);
curl_exec( $ch );
$response = curl_getinfo($ch);
curl_close ($ch);
echo $response["http_code"];
@tiltedlistener
tiltedlistener / gist:81d2d8b3c85753682eff
Created July 16, 2014 06:09
Dealing with coder error in Swift
init(coder aDecoder: NSCoder!)
{
super.init(coder: aDecoder)
}
@tiltedlistener
tiltedlistener / gist:8126eb787b0504c5c1a0
Created July 3, 2014 23:15
Trying to remember format for CoffeeScript object looping
for groupKey, groupValue of WordList
console.log groupValue
doctype html
html(lang="en")
head
meta(charset="utf-8")
meta(http-equiv="X-UA-Compatible", content="IE=edge")
title Site Name
meta(name="description", content="")
meta(name="viewport", content="width=device-width, initial-scale=1.0")
meta(name="mobileoptimized", content="0")
link(href='misc/page.min.css', rel='stylesheet')