Skip to content

Instantly share code, notes, and snippets.

View rf's full-sized avatar

Russ Frank rf

  • Oden Technologies
  • Brooklyn, NY
View GitHub Profile
@$(PYTHON) $(IOS_BUILDER) distribute $(IOS_VER) "`pwd`/build/iphone"\
$(IOS_ID) $(APP_NAME) $(MOBILEPROVISION) \
$(DEVIDENT) "`pwd`/build/" universal | egrep -v '[DEBUG]'
ios-ipa : os-sanity clean clean-src update-rev fonts iphone-images ipad-images
@echo "Executing Titanium build script for iPhone .."
@mkdir -p build/iphone/build/iphone/
@$(PYTHON) $(IOS_BUILDER) distribute $(IOS_VER) "`pwd`/build/iphone"\
$(IOS_ID) $(APP_NAME) $(MOBILEPROVISION) \
$(DEVIDENT) "`pwd`/build/" universal | egrep -v '[DEBUG]'
/usr/bin/xcrun -sdk iphoneos PackageApplication -v \
"build/iphone/build/iphone/build/Release-iphoneos/$(APP_NAME).app" \
-o "`pwd`/build/$(APP_NAME).ipa" \
--sign $(DISTRIB_PROFILE) \
// assuming json string is in `data`
var sections = {},
sectionsArray = [],
section;
try {
data = JSON.parse(data);
data.forEach(function (item) {
if (!sections[item.avatar_id]) {
// we haven't created this section yet
sections[item.avatar_id] = Ti.UI.createTableViewSection();
var dataset = [Row_4, Row_5, (function () { if (class_tf.value === 'Other') return srRow_6; }())];
////////////////////////////////////////////////////////////////////////
var dataset = [];
dataset.push(Row_4);
dataset.push(Row_5);
@rf
rf / gist:1813857
Created February 13, 2012 05:12 — forked from parshap/gist:1813827
irc - async example
// Get a list of rooms...
socket.on('list rooms', function(data){
client.smembers('rooms', function(err, rooms){
var remaining = rooms.length,
array = []
async.forEach(rooms, function (room, done) {
client.hgetall('room_' + room, function (e, result) {
array.push(result);
done();
<?php
# Run an HTTP POST on the specified url, sending json.
function post ($url, $data) {
$ch = curl_init();
$json = json_encode($data);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
/* Another popular pager, most, detects when stdout
* is not a tty and turns into cat. This makes sense. */
if (!isatty(STDOUT_FILENO))
return bb_cat(argv);
var marked = require('marked');
console.dir(marked.lexer("this is a paragraph: `test`\n\nsecondary paragraph: `test2`"));
// [ { type: 'paragraph', text: 'this is a paragraph: `test`\n\n' },
// { type: 'paragraph', text: 'secondary paragraph: `test2`' },
// links: {} ]
06:48 PM russfrank @ clarion ~/code/marked fmt?
$ cat postbench
marked completed in 3516ms.
marked (gfm) completed in 3567ms.
marked (pedantic) completed in 3299ms.
discount completed in 5421ms.
showdown (reuse converter) completed in 9914ms.
showdown (new converter) completed in 11393ms.
markdown-js completed in 27392ms.
@rf
rf / test.js
Created May 23, 2012 17:43
'read only' closures in python
function outer () {
var foo = 'yellow';
function inner () {
foo = 'blue';
}
function out () {
console.log(foo);
}
return [inner, out];
}