Simple wrapper around JSON global that adds graceful error handling via try/catch. 😋
module.exports = (function(){
var parse = JSON.parse;
return {
stringify: JSON.stringify,
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<string-array name="listNames"> | |
<item>5 Minutes</item> | |
<item>10 Minutes</item> | |
<item>15 Minutes</item> | |
<item>30 Minutes</item> | |
<item>60 Minutes</item> | |
</string-array> | |
<string-array name="listValues"> |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<link rel="shortcut icon" href="http://beme.com/icon.png"> | |
<link rel="apple-itouch-icon" href="http://beme.com/icon.png"> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>beme.codes</title> | |
<script> |
var util = require('util'), | |
EventEmitter = require('events').EventEmitter; | |
var Server = function() { | |
var self = this; | |
EventEmitter.call(this); | |
this.on('custom_event', function() { | |
self.logSomething('custom_event'); |
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 |
var str = "myappscheme://foo=bar&hello=world" | |
var queryParamsToJSON = function(str) { | |
var result = {}, name; | |
str = str.split(/:\/\//); | |
str[1].substring(0, str[1].length).split(/\&|=/).forEach(function(item, idx){ | |
idx%2 ? (result[name] = item) : (name = item); | |
}); | |
return result; | |
}; |
top -l 1 | awk '/PhysMem/ {print $2}' | sed s/M// |
// 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 : {}; |
Drag this link to your bookmarks bar: [HN Highlight](javascript:void%20function(){function%20e(e,t,a){var%20n=%22.%22+e+'{%20padding-left:%2030px;background-image:%20url(%22http://www.fasttrackcalltaxi.co.in/ft_clickyourtaxi/App_Images/new_icon.gif%22);%20background-repeat:%20no-repeat;%20}',c=document.head||document.getElementsByTagName(%22head%22)[0],d=document.createElement(%22style%22);d.type=%22text/css%22,d.styleSheet%3Fd.styleSheet.cssText=n:d.appendChild(document.createTextNode(n)),c.appendChild(d);var%20o=[%22second%22,%22seconds%22,%22minute%22,%22minutes%22,%22hour%22,%22hours%22,%22day%22,%22days%22];o=o.slice(0,o.indexOf(a)+1);for(var%20r=document.querySelectorAll('a[href*=%22item%3Fid%22]'),i=0;i%3Cr.length;i++){var%20s=r.item(i);try{var%20l=parseInt(s.innerHTML.match(/^\d+/)),u=s.innerHTML.match(/^\d+%20(.+%3F)%20ago$/)[1]}catch(m){continue}-1!==o.indexOf(u)%26%26(a===u%26%26l%3Et||(s.parentNode