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
#when executing this line with erroneous "]" | |
queue.push([sql_statement + ";\n"], handle_callback]) | |
#compiler returns | |
#node.js:1055:9 |
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
#should the following with an erroneous single ":" instead of "::" | |
SampleClass:sample_function: (string) -> | |
#compile to | |
SampleClass = (sample_function = function sample_function(string) { | |
# as it does now or throw a warning or error? |
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
foo(param, -> | |
foo1() | |
, -> | |
foo2() | |
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
# Executes each part of the iPhone sync serially one after another. | |
# Makes use of the flow-js lib by Will Conant (http://github.com/willconant/flow-js) | |
iphone_sync_flow: -> | |
self: this | |
flow.exec( | |
-> | |
new IPhoneVoicemail(self.username).sync(this) | |
-> | |
new IPhoneCallHistory(self.username).sync(this) | |
-> |
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
# This is a simple little wrapper around the jhead exif reader. | |
# See http://www.sentex.net/~mwandel/jhead/ | |
# Date.js (http://datejs.org). Remove and the below lines if you don't need js dates | |
require "./date" | |
sys: require "sys" | |
path: require "path" | |
PATH_TO_JHEAD: "./external/jhead" | |
jhead_parse: (image_file_or_dir, callback) -> |
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
// | |
// YAJLTopLevelParser.h | |
// | |
// Created by John Wright on 03/29/10. | |
// Copyright 2010. All rights reserved. | |
// | |
// Permission is hereby granted, free of charge, to any person | |
// obtaining a copy of this software and associated documentation | |
// files (the "Software"), to deal in the Software without | |
// restriction, including without limitation the rights to use, |
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
save: (table, obj, tx_flag, callback) -> | |
#augment object with guid unless options say not to | |
if @options.no_guid is false | |
if not _.isArray(obj) | |
obj.guid: Math.uuidFast() | |
else for o in obj | |
o.guid: Math.uuidFast() | |
inserts: [] |
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
foo: (cb) -> | |
arr: [1, 2, 3] | |
do_foo: (i) -> | |
async_call -> | |
if i-- then do_foo(i) | |
else cb() | |
foo(arr.length-1) |
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
require "nosqlite" | |
require "Math.uuid" | |
convert_callback: (row) -> | |
if not row.guid? | |
row.guid: Math.uuidFast(); | |
return row; | |
db_file: "my_db.sqlite" |
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
Topic | |
- NoSQLite | |
- Consider 3 useful things: | |
- SQLite - SQLite is itself a great datastore because it is a | |
fast and powerful SQL database in one file and is widely | |
deployed and supported. | |
- JSON - JSON is a simple and cruft free way to describe and | |
transport objects. That is why programmers love it. There is | |
good support for it in virtually every language. | |
- HTTP - HTTP allows things to connect and talk to each other. |