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 | |
final class WarpDriveEngaged | |
{ | |
private $speed; | |
public function __construct($speed) | |
{ | |
$this->speed = $speed; | |
} |
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 | |
class FooFilter extends ResourceFilter | |
{ | |
public function index() | |
{ | |
// Custom filtering for index(); | |
} | |
public function store() |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
alias ia="open $1 -a /Applications/iA\ Writer.app" |
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/sh | |
if [ -z "$1" ] | |
then | |
echo "No draft file found" | |
exit | |
fi | |
mv $1 _posts/`date +"%Y-%m-%d"`-`basename $1` |
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 | |
# Requirements | |
command -v git > /dev/null 2>&1 || { echo >&2 "I require git but it's not installed. Aborting."; exit 1; } | |
command -v gem > /dev/null 2>&1 || { echo >&2 "I require gem but it's not installed. Aborting."; exit 1; } | |
gem list jekyll -i > /dev/null 2>&1 || { echo >&2 "I require the jekyll ruby gem but it's not installed. Aborting."; exit 1; } | |
# Configuration | |
while [[ -z $PROJECTNAME ]]; do read -p "Enter name of the project: " PROJECTNAME; done | |
while [[ -z $PROJECTDESC ]]; do read -p "Enter description of the project: " PROJECTDESC; done |
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.exports = function(grunt) { | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
less: { | |
development: { | |
files: { | |
"dist/style.min.css": "src/style.less" | |
} | |
} |
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 | |
class Test_Searching_Large_Arrays extends PHPUnit_Framework_TestCase { | |
const SAMPLE_SIZE = 100000; | |
public function test_search() | |
{ | |
$haystack = array(); | |