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
# result of running mongokit_uuid.py with "default_values = { 'my_uuid' : uuid.uuid4 }" | |
> python mongokit_uuid.py | |
Traceback (most recent call last): | |
File "mongokit_uuid.py", line 22, in <module> | |
myid.save() | |
File "/Library/Python/2.6/site-packages/mongokit/document.py", line 398, in save | |
self.validate(auto_migrate=False) | |
File "/Library/Python/2.6/site-packages/mongokit/document.py", line 247, in validate | |
super(Document, self).validate() | |
File "/Library/Python/2.6/site-packages/mongokit/schema_document.py", line 348, in validate |
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 uuid | |
import pymongo | |
if __name__ == '__main__': | |
hasuuid = lambda : { 'my_uuid' : uuid.uuid4() } | |
c = pymongo.Connection() | |
db = c.test # use test database |
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
-module(calc). | |
-export([rpn/1, rpn_test/0, sum_stack/1]). | |
rpn(L) when is_list(L) -> | |
[Result] = lists:foldl(fun rpn/2, [], string:tokens(L, " ")), | |
Result. | |
%% rpn(Op, Stack) | |
rpn("+", [Num1, Num2|Stack]) -> [Num2 + Num1|Stack]; | |
rpn("-", [Num1, Num2|Stack]) -> [Num2 - Num1|Stack]; |
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
PINK = '\033[95m' | |
BLUE = '\033[94m' | |
GREEN = '\033[92m' | |
YELLOW = '\033[93m' | |
RED = '\033[91m' | |
ENDC = '\033[0m' | |
for i in range(0, 10, 2): | |
print "{0} {1:^{2}}{3}".format(RED, '(', i, ENDC) |
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 quicksort(L): | |
if len(L) < 2: | |
return L | |
pivot = L[0] | |
less, greater = [], [] | |
for item in L[1:]: | |
(less if item < pivot else greater).append(item) |
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
NGINX_VERSION=1.0.6 | |
PCRE_VERSION=8.12 | |
# Download nginx | |
if `test ! -f nginx-${NGINX_VERSION}.tar.gz`; then | |
wget http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz | |
fi | |
tar -xzf nginx-${NGINX_VERSION}.tar.gz | |
# Download PCRE for the URL rewrite module |
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
diff --git a/build/ui.js b/build/ui.js | |
index c934168..3fa754d 100644 | |
--- a/build/ui.js | |
+++ b/build/ui.js | |
@@ -9,10 +9,29 @@ var ui = {}; | |
exports.Emitter = Emitter; | |
/** | |
- * Alias emit to Backbone.Events.trigger | |
+ * Initialize a new `Emitter`. |
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
<!DOCTYPE html> | |
<script type="text/javascript" src="/js/jquery-1.7.2.min.js"></script> | |
<script> | |
// $.noConflict(); | |
window.setInterval(getAjax, 3000); | |
// This is getting hoisted | |
function getAjax() { |
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
# Download from: http://downloads.datomic.com/free.html | |
curl -O http://downloads.datomic.com/0.8.3488/datomic-free-0.8.3488.zip | |
unzip datomic-free-0.8.3488.zip | |
cd datomic-free-0.8.3488/ | |
# From: http://docs.datomic.com/getting-started.html | |
# Run the transactor | |
bin/transactor config/samples/free-transactor-template.properties | |
# Should say: |
OlderNewer