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
# Open files modified in a git commit in vim tabs; defaults to HEAD. Pop it in your .bashrc | |
# Examples: | |
# virev 49808d5 | |
# virev HEAD~3 | |
function virev { | |
commit=$1 | |
if [ -z "${commit}" ]; then | |
commit="HEAD" | |
fi | |
rootdir=$(git rev-parse --show-toplevel) |
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 | |
/** | |
* Playing with some of PHP 5.4 RC1's features | |
* | |
* A trait to make an object "mungeable"; i.e. so you can "munge" | |
* methods (closures/lambdas) and properties into it. | |
* | |
* All methods and properties will be public. | |
* | |
* This is pure experimentation. Please do not attempt to derive any |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<title>My awesome homepage</title> | |
<script type="text/javascript"> | |
(function(){ | |
// Press ci" (Change In quotes) with the cursor between |
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 a7209454d1817f0e79b62d78b370cd8390fb1069 Mon Sep 17 00:00:00 2001 | |
From: Tom Hudson <[email protected]> | |
Date: Tue, 15 May 2012 22:55:24 +0100 | |
Subject: [PATCH] Enabled use of XDEBUG_PROFILE trigger from CLI via _ENV | |
globals | |
--- | |
xdebug.c | 3 +++ | |
1 file changed, 3 insertions(+) |
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 | |
// "M" | |
function getUsers(){ | |
// Fetch from DB | |
// ... | |
return $arrayOfUsers; | |
} | |
// "C" | |
$users = array(); |
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
// Files vs. tests in file | |
var files = { | |
'one.js': 12, | |
'two.js': 22, | |
'three.js': 14, | |
'four.js': 10, | |
'five.js': 19, | |
'six.js': 10, | |
'seven.js': 18, | |
'eight.js': 10, |
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 | |
// An experiment: using traits for dependency injection | |
// A trait provides a way to inject a Logger and a way to use it | |
trait aLogger { | |
protected $logger = null; | |
public function setLogger(Logger $logger){ | |
$this->logger = $logger; | |
} | |
public function log($msg){ |
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
package main | |
import ( | |
"net/http" | |
"html/template" | |
"runtime" | |
"os" | |
"os/signal" | |
"syscall" | |
"log" |
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/env php | |
<?php | |
date_default_timezone_set('GMT'); | |
$params = array( | |
"screen_name" => "tomnomnom", | |
"include_rts" => "true" | |
); | |
if (!file_exists('last-id')){ | |
touch('last-id'); |
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
{ | |
"version": "1.2.7", | |
"methods": [ | |
{ | |
"name": "createGroup", | |
"httpMethod": "POST", | |
"arguments": [ | |
] | |
}, |
OlderNewer