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
[ | |
{ | |
"enabled": true, | |
"keyword": "w", | |
"name": "Wikipedia", | |
"url": "http://en.wikipedia.org/w/index.php?search=@@@", | |
"shortcut": "" | |
}, | |
{ | |
"keyword": "default", |
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 | |
# Expand globs to null when there are no matches | |
shopt -s nullglob | |
# Look for either a '<subdir>/console' or a 'symfony' file | |
until | |
file=(*/console symfony); [[ -f "$file" ]] && php "$file" "$@" && exit; | |
do | |
[[ "$PWD" == "/" ]] && break; |
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
# Download, configure, make and install International Components for Unicode | |
wget http://download.icu-project.org/files/icu4c/49.1/icu4c-49_1-src.tgz | |
tar xzvf icu4c-49_1-src.tgz | |
cd icu/source/ | |
./runConfigureICU MacOSX | |
make | |
sudo make install | |
# Install libjpeg support for GD | |
brew install jpeg |
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 | |
function dcra($username, $password, $search) { | |
$tmp_fname = tempnam('/tmp', 'COOKIE'); | |
$curl_handle = curl_init ('https://corp.dcra.dc.gov/Account.aspx/LogOn'); | |
curl_setopt($curl_handle, CURLOPT_COOKIEJAR, $tmp_fname); | |
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, true); | |
curl_setopt($curl_handle, CURLOPT_FOLLOWLOCATION, true); |
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 | |
$links = shell_exec('egrep -o -r "<a[^<]+?(\w*)</a>" --include=*.html *'); | |
$output; | |
foreach(preg_split("/(\r?\n)/", $links) as $line){ | |
$file = explode(':', $line)[0]; | |
preg_match('/(?<=href=")[^"]+?(?=")/', $line, $url_matches); | |
$url = $url_matches[0]; |
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 clickMap = []; | |
for (var i = 0; n = imageData.length; i < n; i += 4) { | |
var row = Math.floor((i/4) / width); | |
var col = (i/4) - (row * width); | |
if(!clickMap[row]) clickMap[row] = []; | |
clickMap[row][col] = imageData[i+3] == 0 ? 0 : 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
{ | |
"name": "node", | |
"subdomain": "nclud", | |
"scripts": { | |
"start": "server.js" | |
}, | |
"version": "0.1.0-70", | |
"engines": { | |
"node": "0.8.x" | |
}, |
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
// <ul data-length="{{records.length}}"> | |
// {{#each_with_index records}} | |
// <li class="legend_item{{this.index}}" z-index="{{this.reverse}}"><span></span>{{this.name}}</li> | |
// {{/each_with_index}} | |
// </ul> | |
Handlebars.registerHelper("each_with_index", function(array, options) { | |
var buffer = ""; | |
for (var i = 0, j = array.length; i < j; i++) { | |
var item = array[i]; |
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
info: Welcome to Nodejitsu nclud | |
info: jitsu v0.11.4, node v0.8.15 | |
info: It worked if it ends with Nodejitsu ok | |
info: Executing command deploy | |
info: Analyzing application dependencies in server.js | |
/usr/local/lib/node_modules/jitsu/node_modules/require-analyzer/node_modules/npm/lib/npm.js:299 | |
if (!conf.hasOwnProperty("prefix")) { | |
^ | |
TypeError: Object #<error> has no method 'hasOwnProperty' |
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 node | |
var buffer = ''; | |
process.stdin.on('data', function(data) { | |
buffer += data; | |
}); | |
process.stdin.on('end', function() { | |
console.log(Array.prototype.slice.call(JSON.parse(buffer.toString())).length); |
OlderNewer