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
// Map function | |
function(doc) { | |
// Split on unicode whitespace or punctuation. | |
// TODO: Is there a unicode-aware \W that I could use? | |
// log('mapping ' + doc); | |
var tokens = doc.text.split(/[\s\,\.\;\:\'\"\(\)\!\?]+/); | |
var words = {}; | |
for each (var token in tokens) { | |
token = token.toLowerCase(); | |
if (token != "") { |
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
diff --git a/gift-4-u.txt b/gift-4-u.txt | |
index ca36d0a..986e9c4 100644 | |
--- a/gift-4-u.txt | |
+++ b/gift-4-u.txt | |
@@ -1,2 +1,2 @@ | |
-I am sending this because you *really* love patch files. :) | |
+Ben Spaulding is my hero (and Daniel really loves patch files). |
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
# You'll need to require these if you | |
# want to develop while running with ruby. | |
# The config/rackup.ru requires these as well | |
# for it's own reasons. | |
# | |
# $ ruby sinatra-test.rb | |
# | |
require 'rubygems' | |
require 'sinatra' | |
require 'json' |
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
from itty import get, post, run_itty | |
try: | |
import json | |
except ImportError: | |
import simplejson as json | |
@get('/') | |
def index(): | |
return json.dumps({'message' : 'Hello, World!'}) | |
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
from itty import * | |
@get('/') | |
def index(foo): | |
return 'Hello World!' | |
run_itty('appengine') |
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
# yes_note.py for PyS60 - Matt Croydon - License: GPL | |
# Requires json.py from http://www.mobilepythonbook.org/ | |
import urllib, json, appuifw | |
BASE_URL = 'http://api.yes.com/1/' | |
station = appuifw.query(u'Enter a station', 'text') | |
station = station.upper() | |
NOW_URL = BASE_URL + 'station?name=%s' % station | |
data = json.read(urllib.urlopen(NOW_URL).read()) |
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
'-._ ___.....___ | |
`.__ ,-' ,-.`-, | |
`''-------' ( p ) `._ FACETIME IS | |
`-' \ NOT SICP! | |
\ | |
\ | |
/---..,--' | |
................._ \--...--, | |
`-.._ _.-' | |
`'-----'' |
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
diff --git a/tests/core/fixtures/initial_data.json b/tests/core/fixtures/initial_data.json | |
index 199988c..2cc5b6f 100644 | |
--- a/tests/core/fixtures/initial_data.json | |
+++ b/tests/core/fixtures/initial_data.json | |
@@ -14,7 +14,7 @@ | |
"fields": { | |
"user": "daniel2", | |
"foo": "bar", | |
- "pub_date": "2009-03-17 06:00:00" | |
+ "pub_date": "2009-03-17 07:00:00" |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
from postneo.category.models import Category | |
from postneo.blog.models import Entry | |
from lxml import etree | |
tree = etree.parse(open('../../../wordpress-20090526.xml', 'r')) | |
def field_data(tree, name): | |
"""Return the text for a field element with a particular name""" | |
return tree.find("field[@name='%s']" % name).text |
OlderNewer