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
val alphabet = "abcdefghijklmnopqrstuvwxyz" | |
def train(text:String) = { | |
"[a-z]+".r.findAllIn(text).foldLeft(Map[String, Int]() withDefaultValue 1) {(a, b) => a(b) = a(b) + 1} | |
} | |
val NWORDS = train(scala.io.Source.fromFile("big.txt").getLines.mkString.toLowerCase) | |
def known(words:Set[String]) = {println("Known invocation: %s" format words); Set.empty ++ (for(w <- words if NWORDS contains w) yield w)} |
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 | |
/** | |
* @file | |
* Test case for Drupal tests using a given install profile. | |
* | |
* Based on work that is copyright 2008-2009 by Jimmy Berry ("boombatower", http://drupal.org/user/214218) | |
*/ | |
class ProvisionWebTestCase extends DrupalWebTestCase { | |
protected function getProfileName() { |
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
svn log -r{2009-12-09}:HEAD | grep '#[0-9]' | awk '{print $1;}' | sed 's/[^0-9]//g' | awk '{ x[$1]++; if (x[$1] == 1) { print $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
svn st | grep "C ht" | sed 's/!//g' | awk '{system(sprintf("svn resolve --accept working %s", $2))}' |
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 | |
// $Id$ | |
$info = array( | |
// Available colors and color labels used in theme. | |
'fields' => array( | |
'base' => t('Base color'), | |
'link' => t('Link color'), | |
'top' => t('Header top'), | |
'bottom' => t('Header bottom'), |
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
/* $Id$ */ | |
/** | |
* Styles and colors that the color module will modify. | |
*/ | |
body, | |
#block-system-main { | |
color: #3b3b3b; | |
} | |
#header { |
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
grep -r -n Cookie . | |
# Grep recursively (-r) for all files in this directory that | |
# contain Cookie (case-sensitive unless -i is used) and print | |
# their line numbers (-n). Outputs: | |
./pressplus.module:179: drupal_set_header('Vary', 'Cookie'); |
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
sub vcl_deliver { | |
if (obj.hits > 0) { | |
set resp.http.X-Cache = "HIT"; | |
} else { | |
set resp.http.X-Cache = "MISS"; | |
} | |
return (deliver); | |
} |
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 | |
date=`date "+%Y-%m-%d"` | |
for i in /Applications/MAMP/db/mysql/*/; do | |
dbname=`basename $i` | |
/Applications/MAMP/Library/bin/mysqldump -uroot $dbname > ~/hdd-smerrill/Documents/Backups/$dbname-$date.sql | |
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
var sys = require("sys"), | |
http = require("http"), | |
growl = require("./node-growl/lib/growl"), | |
child_process = require("child_process"); | |
function createClient() { | |
var i = http.createClient(80, website); | |
// Handle a connection error. | |
// Thanks to http://rentzsch.tumblr.com/post/664884799/node-js-handling-refused-http-client-connections. |
OlderNewer