Skip to content

Instantly share code, notes, and snippets.

View symm's full-sized avatar
🦄

Gareth Jones symm

🦄
View GitHub Profile
@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
*/
@symm
symm / steam-lucasarts-support.diff
Created November 18, 2012 16:09
Steam LucasArts Adventures patch (from http://scummvm.bencastricum.nl/) ported to ScummVM v1.5.0
diff --git a/audio/audiostream.cpp b/audio/audiostream.cpp
index 1c5c435..32b38ef 100644
--- a/audio/audiostream.cpp
+++ b/audio/audiostream.cpp
@@ -33,6 +33,7 @@
#include "audio/decoders/quicktime.h"
#include "audio/decoders/raw.h"
#include "audio/decoders/vorbis.h"
+#include "audio/decoders/cdda.h"
@symm
symm / scram29c3.js
Created December 7, 2013 13:15
JavasScript text scrambler effect from the old 29c3 website
String.prototype.replaceAt=function(index, char ) { return this.substr(0, index) + char + this.substr(index+char.length); }
String.prototype.replace2At=function(index, char1, char2 ) { return this.substr(0, index) + char1 + char2 + this.substr(index+char1.length+char2.length); }
function scram29c3run() {
var elem = document.getElementById( 'header-29c3-scramble' );
if ( elem ) { var scram = new scram29c3( elem ); scram.run(); } else
{ setTimeout( scram29c3run, 500 ); }
elem = document.getElementById( 'header-29c3-scramble2' );
if ( elem ) { var scram = new scram29c3( elem ); scram.run(); }
}
GIT_COMMITTER_DATE="`date`" git commit --amend --date "`date`"
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