Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View symm's full-sized avatar
🦄

Gareth Jones symm

🦄
View GitHub Profile
GIT_COMMITTER_DATE="`date`" git commit --amend --date "`date`"
@symm
symm / composer.json
Created April 13, 2015 21:29
Github Label Manager
{
"require": {
"guzzlehttp/guzzle": "~5.2"
}
}
@symm
symm / ee-data-usage.rb
Last active August 29, 2015 14:25
A little script for showing the remaining data allowance on EE data SIM
#!/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
find . -name '*.java' ! -type d -exec bash -c 'expand -t 4 "$0" > /tmp/e && mv /tmp/e "$0"' {} \;
@symm
symm / gist:3260113
Created August 4, 2012 21:39
PHP url validation bug
<?php
/*
* FILTER_VALIDATE_URL Validates value as URL (according to » http://www.faqs.org/rfcs/rfc2396)
* http://php.net/manual/en/filter.filters.validate.php
*/
$check = filter_var('http://google.com/', FILTER_VALIDATE_URL);
var_dump($check);
// $check = string(18) "http://google.com/"
@symm
symm / composer.json
Created November 8, 2012 20:43
Returns the episode titles a certain American Podcast series
{
"require":
{
"symfony/dom-crawler": "2.2.x-dev",
"symfony/css-selector": "2.2.x-dev"
}
}
@symm
symm / deploy.rb
Last active October 12, 2015 16:58
Capifony config for Symfony 2.1 Project Deployment
set :application, "symfony"
set :domain, "#{application}.yourdomain.com"
set :deploy_to, "/www/#{domain}"
set :app_path, "app"
set :user, "yourusername"
set :repository, "file:///local/path/to/project/repo"
set :scm, :git
set :deploy_via, :copy
@symm
symm / symfony.conf
Last active October 12, 2015 16:58
Nginx Symfony 2.1 vhost config
server {
listen 80;
server_name yourdomain.com;
root /www/yourdomain.com/current/web;
error_log /var/log/nginx/yourdomain.error.log;
access_log /var/log/nginx/yourdomain.access.log;
# strip app.php/ prefix if it is present
@symm
symm / gromlist.diff
Created November 12, 2012 11:44
Hack in Zip file support to gromlist (http://mundogeek.net/gromlist/)
--- /usr/lib/gromlist/gromlist.py 2012-11-12 11:36:55.697698407 +0000
+++ gromlist.py 2012-11-12 11:41:32.703071996 +0000
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#:!/usr/bin/env python
# -*- coding: UTF-8 -*-
###
#
@@ -1047,8 +1047,21 @@
# Calculate the CRC of the files in the rom folder
@symm
symm / kernel-checker.php
Created November 12, 2012 17:33
Linode Kernel version alerting.
<?php
/*
* Linode Kernel Version alerter.
*
* Fetches a list of the available Linode kernels and alerts you if
* your currently running version is out of date.
*
* Crontab: * 23 * * php /path/to/this/script
* @author Gareth Jones
*/