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
1) Install MongoDB and launch it: | |
21:44:59 ^ $ /opt/local/bin/mongod --dbpath=/opt/mongo-data/ | |
Wed Aug 19 21:45:10 Mongo DB : starting : pid = 6578 port = 27017 dbpath = /opt/mongo-data/ master = 0 slave = 0 32-bit | |
** NOTE: when using MongoDB 32 bit, you are limited to about 2 gigabytes of data | |
** see http://blog.mongodb.org/post/137788967/32-bit-limitations for more | |
Wed Aug 19 21:45:10 db version v0.9.8, pdfile version 4.4 | |
Wed Aug 19 21:45:10 git version: nogitversion |
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
=== Epic Snow Leopard Upgrayyyyd Guide === | |
Son, you’re now living in the land of 64-bit systems. | |
That means that some of your 32-bit shit is now broken. | |
Not all is lost. | |
== Fixing MySQL weirdness |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" | |
"http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>org.mongodb.mongod</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/opt/local/bin/mongod</string> |
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
# coding=utf-8 | |
# Google async translate demo using Tornado | |
# Author: Sébastien Arnaud (arnaudsj@gmail.com) | |
# License: Creative Commons Attribution-Share Alike 3.0 United States License (http://creativecommons.org/licenses/by-sa/3.0/us). | |
import tornado.httpclient as httpclient | |
import tornado.ioloop as ioloop | |
import urllib | |
import simplejson as 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
Ruby 1.8.6 w/o C extension | |
========================== | |
user system total real | |
single object inserts: 3.450000 0.160000 3.610000 ( 3.779446) | |
multiple object insert: 2.190000 0.020000 2.210000 ( 2.223418) | |
find_one: 0.070000 0.000000 0.070000 ( 0.087103) | |
Ruby 1.8.6 w/ C extension | |
========================= | |
user system total real |
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 python2.6 | |
# -*- coding: utf-8 -*- | |
""" | |
Code snippet that shows how to convert a utf-8 encoded string to an XML decimal entity string | |
""" | |
from xml.sax import saxutils | |
import codecs | |
if __name__ == "__main__": |
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 python | |
# | |
# Jamie Kirkpatrick, November 2009. <jkp@kirkconsulting.co.uk> | |
# Released under the BSD license. | |
# | |
""" | |
Experimental code to add asyncronous functionality to WSGI applications | |
running under the Tornado webserver. Uses greenlet to spin micro-threads | |
which can be suspended and resumed within a single thread as required. |
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
import logging | |
import random | |
import tornado.httpserver | |
import tornado.ioloop | |
import tornado.options | |
import tornado.web | |
from tornado.options import define, options |
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
#Newbie programmer | |
def factorial(x): | |
if x == 0: | |
return 1 | |
else: | |
return x * factorial(x - 1) | |
print factorial(6) | |
#First year programmer, studied Pascal |
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
####################### | |
#### DOCUMENTATION #### | |
####################### | |
# | |
# Run as: | |
# | |
# ruby phonegap-sc.rb APP_NAME | |
# ruby phonegap-sc.rb APP_NAME PROJECT_PATH | |
# ruby phonegap-sc.rb APP_NAME PROJECT_PATH OUTPUT_PATH | |
# |