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
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: {} ] |
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
/* 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); |
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
<?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); |
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
// 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(); |
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
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); |
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
// 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(); |
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
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) \ |
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
@$(PYTHON) $(IOS_BUILDER) distribute $(IOS_VER) "`pwd`/build/iphone"\ | |
$(IOS_ID) $(APP_NAME) $(MOBILEPROVISION) \ | |
$(DEVIDENT) "`pwd`/build/" universal | egrep -v '[DEBUG]' |
NewerOlder