Skip to content

Instantly share code, notes, and snippets.

Avatar
🦄

Gareth Jones symm

🦄
View GitHub Profile
View gist:9171835
GIT_COMMITTER_DATE="`date`" git commit --amend --date "`date`"
View gist:9171844
brew install dnsmasq
mkdir -pv $(brew --prefix)/etc/
echo 'address=/.dev/127.0.0.1' > $(brew --prefix)/etc/dnsmasq.conf
sudo cp -v $(brew --prefix dnsmasq)/homebrew.mxcl.dnsmasq.plist /Library/LaunchDaemons
sudo launchctl load -w /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
sudo mkdir -v /etc/resolver
sudo bash -c 'echo "nameserver 127.0.0.1" > /etc/resolver/dev'
@symm
symm / gist:3920f70cc47a9c9b5293
Last active Aug 29, 2015
Composer checksums
View gist:3920f70cc47a9c9b5293
dd703cf132b2a6bb9b2a407ef8834cab9f433cf04f252f1a125b09f8f7a46912 ./1.0.0-alpha1/composer.phar
acc373396d66d0083231a9d90691886e894ccca778398258e44c3dab60db2363 ./1.0.0-alpha2/composer.phar
7cac0a430602342a60949e580d49fefde57b5ff53d4b488e18d78aabf57eef19 ./1.0.0-alpha3/composer.phar
b1f5737a3916ad34f74566be51d21f3597d9aebaa382d942c5bda4d1338008b3 ./1.0.0-alpha4/composer.phar
7e0fd9248b0f03ddbb3d20d4be2d130fecce432b66ff96f6e99a906f85d82796 ./1.0.0-alpha5/composer.phar
eacac2a637de230e6091fdb45e893705049f929c271a5dc90d2c9eac0f44c5c4 ./1.0.0-alpha6/composer.phar
8fb4ac2da72856394b4bdd65d470797b23c27d496821a456046527fe6ccc9786 ./1.0.0-alpha7/composer.phar
1c73973d7cfb73f3e6b425b943a3e1459f5199984f37f008c48cf2b671dd3f2b ./1.0.0-alpha8/composer.phar
33ef1c07649bc1e135e73f0944415753233faf803cff493006f8bd9e744ff1f4 ./1.0.0-alpha9/composer.phar
9f2c7d0364bc743bcde9cfe1fe84749e5ac38c46d47cf42966ce499135fd4628 ./1.0.0-alpha10/composer.phar
View Makefile
all: permissions npm-install gulp composer-install unit-tests db-migrate
npm-install:
npm install
composer-install:
composer install --no-dev --verbose --prefer-dist --optimize-autoloader --no-progress
unit-tests:
bin/phpspec run
View disable-vlc-and-quicktime-history.sh
defaults write org.videolan.vlc NSRecentDocumentsLimit 0
defaults delete org.videolan.vlc.LSSharedFileList RecentDocuments
defaults write org.videolan.vlc.LSSharedFileList RecentDocuments -dict-add MaxAmount 0
defaults write com.apple.QuickTimePlayerX NSRecentDocumentsLimit 0
defaults delete com.apple.QuickTimePlayerX.LSSharedFileList RecentDocuments
defaults write com.apple.QuickTimePlayerX.LSSharedFileList RecentDocuments -dict-add MaxAmount 0
@symm
symm / composer.json
Created Apr 13, 2015
Github Label Manager
View composer.json
{
"require": {
"guzzlehttp/guzzle": "~5.2"
}
}
View transplant.py
#!/usr/bin/env python
from deluge._libtorrent import lt
from deluge.core.torrentmanager import TorrentManagerState
from shutil import copy, _samefile
import cPickle
import os
class Transplant(object):
def __init__(self, config_dir="", torrent_ids=None, torrents=None):
self.state_dir = ""
View gist:052743434f7cbeaf1cc6
server {
listen 80;
root {{ doc_root }};
index index.html index.php;
server_name {{ server_name }};
if (-f {{ doc_root }}/maintenance.html) {
return 503;
@symm
symm / varnish-dns-reload.sh
Last active Aug 29, 2015
Reload varnish when DNS gets changed
View varnish-dns-reload.sh
#!/bin/bash
# Restart varnish when we see a change in the DNS serial
PROGRAM_NAME="Varnish DNS Reloader"
LOCKFILE="/tmp/varnish-dns-refresh.lock"
ZONE="yourdomain.com"
SERIAL_STORAGE="/tmp/yourdomain-serial"
mkdir $LOCKFILE || exit 1
@symm
symm / ee-data-usage.rb
Last active Aug 29, 2015
A little script for showing the remaining data allowance on EE data SIM
View ee-data-usage.rb
#!/usr/bin/env ruby
require 'mechanize'
require 'filecache'
cache = FileCache.new("data-usage", "/tmp", 60 * 30, 3)
unless cache.get('usage').nil?
puts cache.get('usage')
exit 0