C -> D o D
D -> C
D -> t
D -> D o D
D -> t
This file contains hidden or 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 binarySearch (array, matcher) { | |
var len = array.length, | |
head = 0, | |
tail = len - 1, | |
offset = got = Math.ceil(tail / 2); | |
if (offset == tail) { | |
return offset; | |
} | |
This file contains hidden or 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
/** | |
* usage: | |
* | |
* $ node migrate.js path/to/posts/dir | |
*/ | |
var fs = require('fs'); | |
var path = require('path'); | |
var ENCODING = 'utf8'; |
This file contains hidden or 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
export PS1="\w $ " | |
export CLICOLOR=1 | |
export GREP_OPTIONS="--color=auto" | |
alias cl="source cl.sh" | |
alias work="cd ~/work" | |
alias ll="ls -al" | |
alias ahosts="vi ~/etc/apache2/httpd-vhosts.conf" | |
alias vhosts="sudo vi /etc/hosts" | |
alias subl='open -a "Sublime Text 2"' |
This file contains hidden or 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
app.set('partials', require('./lib/partials')); |
This file contains hidden or 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 if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
/** | |
* CodeIgniter | |
* | |
* @package php-bootstrap | |
* @author mytharcher | |
* @copyright Copyright (c) since 2013 | |
* @license MIT Licenced | |
*/ |
This file contains hidden or 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
# This config is used for Dreamhost which HTTP basic authoriztion is forbidden. | |
# The PHP Server variable 'PHP_AUTH_USER' & 'PHP_AUTH_PW' could be implement by | |
# this config via a CGI environment variable. | |
# From [HTTP Authentication on PHP as CGI (like Dreamhost)](http://planetozh.com/blog/2009/04/http-authentication-on-php-as-cgi-like-dreamhost/) | |
RewriteEngine on | |
RewriteRule ^git-hook.*\.php - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L] |
This file contains hidden or 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 fs = require('fs'); | |
var path = require('path'); | |
var ENCODING = 'utf8'; | |
var target = process.argv[2]; | |
fs.readdirSync(target).forEach(function (file) { | |
var filePath = path.join(__dirname, target, file); | |
var content = fs.readFileSync(filePath, ENCODING) |
This file contains hidden or 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 Class (proto, Super) { | |
// use noop function as default constructor if user not defined as in Java | |
var i, newClass = proto.hasOwnProperty('constructor') ? proto.constructor : function () {}; | |
if (Super) { | |
var SuperHelper = function () {}; | |
SuperHelper.prototype = Super.prototype; | |
// make `instanceof` could be use to check the inheritance relationship |
This file contains hidden or 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
{ | |
"en_US": {"dir": "ltr", "name": "English"}, | |
"de": {"dir": "ltr", "name": "Deutsch"}, | |
"fr_FR": {"dir": "ltr", "name": "français (France)"}, | |
"fr_CA": {"dir": "ltr", "name": "français (Canada)"}, | |
"ca": {"dir": "ltr", "name": "català"}, | |
"pt_BR": {"dir": "ltr", "name": "português"}, | |
"fa_IR": {"dir": "rtl", "name": "پارسی"}, | |
"zh_CN": {"dir": "ltr", "name": "中文"}, | |
"nl": {"dir": "ltr", "name": "Nederlands"}, |