View FPSMonitor.js
(function(target, engine, interval) { | |
var surface = new Surface({ | |
size: [50, 35], | |
content: '', | |
properties: { | |
color: 'white', | |
textAlign: 'center', | |
backgroundColor: '#FA5C4F', | |
border: '1px solid black' |
View backbone_fetch_monkeypatch.js.coffee
root = exports ? this | |
# Overloading backbone fetch method | |
previousFetch = Backbone.Collection.prototype.fetch | |
root.Backbone.Collection.prototype.fetch = (options={})-> | |
asyncUniqId = _.uniqueId 'time_'+@constructor.name+'_' | |
console.time asyncUniqId | |
previousSuccess = if options? then options.success else undefined | |
options = _.extend(options, | |
success: => |
View _log.js.coffee
root = exports ? this | |
root._log = -> | |
args = [new Date()].concat Array.prototype.slice.apply(arguments) | |
console.log.apply console, args |
View counter.scss
.custom-counter{ | |
list-style-type: none; | |
&>li{ | |
counter-increment: step-counter; | |
&:before{ | |
content: counter(step-counter); | |
} | |
} |
View meteor.cors.js
/* | |
Enable iron-router route to run cross-origin resource sharing | |
Usage: | |
Router.route('/ping', function(){ | |
(new Cors(this)).respondWith({"oh": "yeah"}); | |
}, {where: 'server'}); | |
Note: dependency on underscore.js (what meteorjs app doesn't anyway ;) | |
*/ |
View stub.js.coffee
# Usage: window.myObject = _.stub('myObject', {error: null, print: null}) | |
_.mixin | |
stub: (objectName, props)-> | |
res = {}; | |
for prop of props | |
if props[prop]? | |
res[prop] = props[prop] | |
else | |
res[prop] = ((method)-> | |
-> |
View snippets.cson
'.source.js': | |
'ReactNative Component': | |
'prefix': 'rnc' | |
'body': """ | |
'use strict'; | |
import React, { | |
Text, | |
} from 'react-native'; |
View scope_explorer.js
/* | |
* Explore/Spy App Global variables, excluding defaults (defaults comes down a scope) | |
* > Run me in your dev tool console via copy/pasting | |
* > In return, I provide a list of keys, and copy in your clipboard (how sweet is that!) | |
* | |
* Follow my creator https://twitter.com/grabthecode | |
*/ | |
;(function(scope, defaults){ |
View validCandidate.js
function validCandidate(languages) { | |
let validCandidate = false | |
let languageRegex = /script$/ | |
if(Array.isArray(languages)) { | |
validCandidate = !!languages.filter( (language)=> languageRegex.test(language) ).length | |
} else if (typeof languages == 'string') { | |
validCandidate = languageRegex.test(languages) | |
} | |
return validCandidate | |
} |
OlderNewer