Simple wrapper around JSON global that adds graceful error handling via try/catch. 😋
module.exports = (function(){
var parse = JSON.parse;
return {
stringify: JSON.stringify,
Simple wrapper around JSON global that adds graceful error handling via try/catch. 😋
module.exports = (function(){
var parse = JSON.parse;
return {
stringify: JSON.stringify,
| 'Label[platform=android]': { | |
| color: '#000' // all platforms except Android default to black | |
| } | |
| 'Window': { | |
| backgroundColor: '#fff' // white background instead of default transparent | |
| } | |
| 'Window[platform=android]': { | |
| modal: false // make android windows all heavyweight |
| #!/bin/bash | |
| # mov2giv in out width | |
| # mov2gif video_file_in.mov gif_file_out.gif 300 | |
| tmp_dir=/tmp/frames_$(date +%s) | |
| mkdir $tmp_dir | |
| if [ -z "$3" ] | |
| then | |
| size=600 |
| // backbone collections lack a search functionality. This adds it to all collections. | |
| // fuse.js is the library that powers the fuzzy search and requires being downloaded and included into your app | |
| // http://kiro.me/projects/fuse.html | |
| _.extend(Backbone.Collection.prototype, { | |
| searchableFields: null, | |
| buildSearchIndex: function(options) { | |
| options = (typeof options !== 'undefined') ? options : {}; |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
| // next two from http://stackoverflow.com/a/5624139/292947 | |
| function componentToHex(c) { | |
| var hex = c.toString(16); | |
| return hex.length == 1 ? "0" + hex : hex; | |
| } | |
| function rgbToHex(r, g, b) { | |
| return "#" + componentToHex(r) + componentToHex(g) + componentToHex(b); | |
| } |
| <!-- note the ONLY change to this is the additional module="tabIndicator" | |
| attribute + properties to override indicator defaults //--> | |
| <Alloy> | |
| <TabGroup module="tabIndicator" tabsBackgroundColor="#000" tabIndicatorHeight="1" tabIndicatorColor="white" tabIndicatorWidth="75%"> | |
| <Tab title="Tab 1" icon="/images/icons/519-tools-1.png" activeIcon="/images/icons/519-tools-1_active.png" color="#555" activeColor="#fff"> | |
| <Window title="Tab 1" barColor="black" navTextColor = "#fff"> | |
| <Label onClick="openWin1">Tab 1</Label> | |
| </Window> | |
| </Tab> | |
| <Tab title="Tab 2" icon="/images/icons/516-archive-box.png" activeIcon="/images/icons/516-archive-box_active.png" color="#555" activeColor="#fff"> |
| <?php | |
| /* A quick emulator for common curl function so code based on CURL works on AppEngine */ | |
| if(!function_exists('curl_init')) | |
| { | |
| // The curl option constants, when there is no curl they are not defined so we define them here | |
| // Some options don't do anything, they just prefent crashes when they are here (see the setOpt method for the support of different options) | |
| define('CURLOPT_RETURNTRANSFER', 'CURLOPT_RETURNTRANSFER'); | |
| define('CURLOPT_SSL_VERIFYPEER', 'CURLOPT_SSL_VERIFYPEER'); |
| const int clockPin = 13; | |
| const int dataPin = 11; | |
| const int latchPin = 10; | |
| byte arrow[8]={0x18,0x3C,0x66,0xDB,0x18,0x18,0x18,0x18}; | |
| byte displayBuffer[8]= {0}; | |
| int fontDefinitions[475] = { | |
| 0x00,0x00,0x00,0x00,0x00,/*space*/ // is 32 in ASCII | |
| 0x00,0xF6,0xF6,0x00,0x00,/*!*/ |
| var mongo = require('mongodb') | |
| ,jqd = require('../jquery-jqd').jqd | |
| ,host = process.env['MONGO_NODE_DRIVER_HOST'] != null | |
| ? process.env['MONGO_NODE_DRIVER_HOST'] : 'localhost' | |
| ,port = process.env['MONGO_NODE_DRIVER_PORT'] != null | |
| ? process.env['MONGO_NODE_DRIVER_PORT'] : mongo.Connection.DEFAULT_PORT | |
| ,db = null | |
| ,gConnection = null; | |