Skip to content

Instantly share code, notes, and snippets.

View zedd45's full-sized avatar
๐Ÿ˜
I may be slow to respond.

Chris Keen zedd45

๐Ÿ˜
I may be slow to respond.
View GitHub Profile
@pthrasher
pthrasher / simplate.php
Created February 2, 2012 17:23
A very very simple templating class for php... seriously... probably has too few features.
<?php
class Simplate {
/*
* Sets include file name, and sanitizes vars.
*/
function __contruct($template_name = '404', $vars = array()) {
// Escapt all values by default.
$this->template_vars = $this->sanitize_vars($vars);
@mxcl
mxcl / uninstall_homebrew.sh
Created August 26, 2011 11:25
Uninstall Homebrew
#!/bin/sh
# Just copy and paste the lines below (all at once, it won't work line by line!)
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY!
function abort {
echo "$1"
exit 1
}
set -e
@craveytrain
craveytrain / client-withCredentials.js
Created June 16, 2011 02:20
Cross domain scripting with jQuery
$.ajaxPrefilter('json', function(options, orig, jqXHR) {
if (options.crossDomain && !$.support.cors) return 'jsonp'
});
$.ajax({
url: 'http://nodeserver:3000',
dataType: 'json',
success: callback,
xhrFields: {
withCredentials: true
@cjohansen
cjohansen / gist:739589
Created December 13, 2010 20:55
Showing how to fake server requests with Sinon.JS and Jasmine
/*
Load Sinon.JS in the SpecRunner:
<script type="text/javascript" src="lib/jasmine-1.0.1/jasmine.js"></script>
<script type="text/javascript" src="lib/jasmine-1.0.1/jasmine-html.js"></script>
<script type="text/javascript" src="sinon-1.0.0.js"></script>
<script type="text/javascript" src="sinon-ie-1.0.0.js"></script>
http://cjohansen.no/sinon/
*/