Skip to content

Instantly share code, notes, and snippets.

View smerrill's full-sized avatar
🤖
Attention is all you need

Steven Merrill smerrill

🤖
Attention is all you need
View GitHub Profile
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');
/* $Id$ */
/**
* Styles and colors that the color module will modify.
*/
body,
#block-system-main {
color: #3b3b3b;
}
#header {
<?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'),
svn st | grep "C ht" | sed 's/!//g' | awk '{system(sprintf("svn resolve --accept working %s", $2))}'
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; } }'
<?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() {
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)}