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
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 | |
# $Id: Portfile 71588 2010-09-17 05:21:24Z [email protected] $ | |
PortSystem 1.0 | |
name php5 | |
conflicts php5-devel php52 | |
# Update revision of php5-eaccelerator when updating version of php5 | |
epoch 1 | |
version 5.3.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
### | |
### HG Hook script | |
### - allows filtering and other actions to be | |
### run at a designated hook. | |
### | |
# a copy of each file along with it's directory structure | |
# is placed here when the script is initially run. | |
$BACKUP_DIR = "~/_hg_modified"; |
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 ( | |
"log" | |
"net" | |
"net/rpc" | |
"sync" | |
"time" | |
) |
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 ( | |
"log" | |
"net" | |
"net/rpc" | |
) | |
type System int |
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
function cd() { | |
builtin cd $@ | |
if [[ -e .goenv ]]; then | |
source .goenv | |
fi | |
} | |
function gengo() { | |
local project=${1?:"Usage: gengo <projectname> [<git origin url>]"} | |
[ ! -d "$project" ] && mkdir "$project" && builtin cd "$project" && mkdir -p src bin pkg && |
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
function ctx_to_object_url(ctx) { | |
var img_bytes = atob(ctx.canvas.toDataURL().substring('data:image/png;base64,'.length)), | |
ua = new Uint8Array(new ArrayBuffer(img_bytes.length)); | |
for (var i = 0; i <= ua.length; i++) { | |
ua[i] = img_bytes.charCodeAt(i); | |
} | |
return (window.URL || window.webkitURL).createObjectURL(new Blob([ua], { type: 'image/png' })); |
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
function generate_dom(string) { | |
var t = document.createElement('div'); | |
t.innerHTML = string; | |
return t.children.length === 1 ? t.children[0] : t.children; | |
} |
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
function fill(x,y) { | |
if (c.getImageData(x,y, 1,1).data[0] !== 0) { | |
c.fillRect(x,y, 1,1); | |
fill(x-1, y-1); fill(x, y-1); fill(x+1, y-1); | |
fill(x-1, y); /* current */ fill(x+1, y); | |
fill(x-1, y+1); fill(x, y+1); fill(x+1, y+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
function gethub() { | |
cd ~/Code | |
if [[ ! -d "$1" ]]; then | |
git clone [email protected]:$1 "$1" | |
fi | |
cd "$1" && sub . | |
} |
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 | |
// w.WriteHeader(200) -> w.WriteHeader(http.StatusOK) // 200 | |
array_map(function($a) { | |
$data = file_get_contents($a); | |
$data = preg_replace_callback("/\.WriteHeader\((\d+)\)/", function($d) { | |
static $constants = array( | |
100 => 'http.StatusContinue', | |
101 => 'http.StatusSwitchingProtocols', |
OlderNewer