This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
php -r ' | |
$matches = array("short_open_tag = Off", ";error_log = syslog", "display_errors = Off", "html_errors = Off"); | |
$replacements = array("short_open_tag = On", "error_log = syslog", "display_errors = On", "html_errors = On"); | |
foreach(glob("/etc/php5/*/php.ini") as $file) { file_put_contents($file, str_replace($matches, $replacements, file_get_contents($file)));} | |
' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Requires s3cmd | |
# https://github.com/s3tools/s3cmd | |
# Variables | |
LIVE_BUCKET="s3://$1" | |
SITE_DIR='_site/' # run this script from your Jekyll root folder. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.greet = function( player ) { | |
echo( player, 'Hi ' + player.name); | |
} | |
var mine = { | |
house: function () { | |
var drone = box(blocks.brick.mossy,7,5,7); | |
drone.up().fwd(1).right(1); | |
drone.box(blocks.air,5,4,5); | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ee = createEE() | |
ee.emit('foo', [1, 2, 3]) | |
ee.on('bar', function (a, b, c) { | |
console.log('bar: ' + a); | |
return b; | |
}); | |
console.log('emit returned: ' + ee.emit('bar', [1, 2, 3])); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Based on the work of Tim Brown from http://alistapart.com/article/more-meaningful-typography | |
@fontRatioBase: 16; //In pixels | |
@fontRatioScale: 1.618; | |
.font-rem(@size) { | |
font-size: @size * @fontRatioBase * 1px; | |
font-size: @size * 1rem; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Jekyll | |
class LessCssFile < StaticFile | |
attr_accessor :styles | |
def destination(dest) | |
File.join(dest, @dir, @name.sub(/less$/, 'css')) | |
end | |
def write(dest) | |
dest_path = destination(dest) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//(c) 2013 Dave Poole zastica.com | |
//BatChannel.js - a system for batching ajax requests | |
// | |
//assumes (requires) that your server side code can handle | |
//routing the urls on it's own, and responds with something | |
//like this: { success: (true | false), ...other data.. } | |
var BatChannel = function(endpoint, interval) { | |
this.endpoint = endpoint; | |
this.pending = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image | |
backgroundColor = (0,)*3 | |
pixelSize = 9 | |
image = Image.open('input.png') | |
image = image.resize((image.size[0]/pixelSize, image.size[1]/pixelSize), Image.NEAREST) | |
image = image.resize((image.size[0]*pixelSize, image.size[1]*pixelSize), Image.NEAREST) | |
pixel = image.load() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function(){window.open('data:text/html,%20<html%20contenteditable>');})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php | |
<?php | |
/** | |
* .git/hooks/pre-commit | |
* | |
* This pre-commit hooks will check for PHP error (lint), and make sure the code | |
* is PSR compliant. | |
* | |
* Dependecy: PHP-CS-Fixer (https://github.com/fabpot/PHP-CS-Fixer) | |
* |
NewerOlder