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
# syllables.py | |
# ------------ | |
# get cmu_dict_file from http://webdocs.cs.ualberta.ca/~kondrak/cmudict.html | |
from collections import defaultdict | |
PHONEMES = set(['AA', 'AH', 'AW', 'B', 'D', 'EH', 'EY', 'G', 'IH', 'JH', 'L', 'N', 'OW' , 'P', 'S', 'T', 'UH', 'V', 'Y', 'ZH', 'AE', 'AO', 'AY', 'CH', 'DH' , 'ER', 'F', 'HH', 'IY', 'K', 'M', 'NG', 'OY', 'R', 'SH', 'TH' , 'UW', 'W', 'Z']) | |
VOWEL_PHONEMES = set(['AA', 'AH', 'AW', 'EH', 'ER', 'EY', 'IH', 'OW' , 'UH', 'AE', 'AO', 'AY', 'IY', 'OY', 'UW']) |
This file has been truncated, but you can view the full file.
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
étui | |
études | |
étude | |
étagères | |
étagère | |
épées | |
épée | |
émigrés | |
émigré | |
élan |
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
def fragmention(self, bookmark): | |
# Normalize whitespace and encode text as UTF8 | |
text = ' '.join(self.text.split()).encode('utf-8') | |
url_parts = urlparse(bookmark.url) | |
# If the URL has no path (i.e. http://google.com) add a "/" then append fragmention | |
formatter = '%s/##%s' if not len(url_parts.path) else '%s##%s' | |
fragmention_url = formatter % (url_parts.geturl(), urllib.quote_plus(text)) | |
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 is at: https://gist.github.com/8655399 | |
;; So we want a rhyming dictionary in Clojure. Jack Rusher put up | |
;; this code here: | |
;; | |
;; https://gist.github.com/jackrusher/8640437 | |
;; | |
;; I'm going to study this code and learn as I go. | |
;; | |
;; First I put it in a namespace. |
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
object GOption { | |
def some[A](a: A): GOption[A] = new GOption[A] { | |
def cata[B](n: => B, s: A => B): B = sys.error("Implement me") | |
} | |
def none[A]: GOption[A] = new GOption[A] { | |
def cata[B](n: => B, s: A => B): B = sys.error("Implement me") | |
} | |
} | |
trait GOption[+A] { |
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
/** | |
* Author: Michael Weibel <[email protected]> | |
* License: MIT | |
*/ | |
var passport = require('passport') | |
, StrategyMock = require('./strategy-mock'); | |
module.exports = function(app, options) { | |
// create your verify function on your own -- should do similar things as |
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
#!/usr/bin/env python | |
import tweepy | |
from BeautifulSoup import BeautifulSoup as parser | |
import urllib | |
import sys | |
import argparse | |
import ConfigParser |
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
import scalaz._ | |
import Scalaz._ | |
case class Person(name: String, score: Int) | |
object Main extends App { | |
type Environment = Map[String, Person] | |
type EnvReader[+A] = Kleisli[Option,Environment,A] | |
type UserReader[+A] = Kleisli[EnvReader,String,A] |
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.use(require('connect-flash')()); | |
// Expose the flash function to the view layer | |
app.use(function(req, res, next) { | |
res.locals.flash = function() { return req.flash() }; | |
next(); | |
}) |
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
{ | |
"AL": "Alabama", | |
"AK": "Alaska", | |
"AS": "American Samoa", | |
"AZ": "Arizona", | |
"AR": "Arkansas", | |
"CA": "California", | |
"CO": "Colorado", | |
"CT": "Connecticut", | |
"DE": "Delaware", |