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
ln -s /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app /Applications/iPhone\ Simulator.app |
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
/** | |
@HashRouter: Singleton hash router object. | |
// define onroute function | |
HashRouter.onroute = function(hash){} | |
// start the router | |
HashRouter.start(); |
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
function rateLimit(func, time){ | |
var callback = func, | |
waitTimeout, | |
waiting = false, | |
context = this; | |
var rtn = function(){ | |
if(waiting) return; | |
waiting = true; | |
var args = arguments; |
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
/* | |
http://x-tags.org/docs | |
usage: | |
const ComponentBase = require('./component-base') | |
xtag.register('x-foo', { | |
prototype: ComponentBase.prototype, |
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
// http://x-tags.org/docs | |
const ComponentBase = require('./component-base') | |
xtag.register('x-boilerplate', { | |
prototype: ComponentBase.prototype, | |
lifecycle: { |
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 fs = require('fs') | |
fs.writeFileSync(path.join(__dirname, 'public/styles/_inject.scss'), `$CDN: "${CDN}";`, 'utf8') |
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
(function(){ | |
var noop = function noop(){}; | |
var liveConsole = console; | |
var consoleMethodNames = 'assert assert clear count debug dir dirxml error group groupCollapsed groupEnd info log markTimeline profile profileEnd table time timeEnd timeStamp timeline timelineEnd trace warn'.split(' '); | |
var deadConsole = {}; | |
for (var i = consoleMethodNames.length - 1; i >= 0; i--) { | |
deadConsole[consoleMethodNames[i]] = noop; | |
}; | |
window.__debug = function (enabled){ | |
if(enabled){ |
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
/* | |
LazyPromise is a cachey promise creator that returns a function. | |
It's good for lazily running things only once. | |
Promise creation is deferred until the first call. | |
Construct using same signature as a regular Promise (except it doesn't require `new`). |
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
/** | |
Event broadcasting that follows the on / off / trigger pattern | |
@arg obj: optional object to extend with events. NOTE: this event system only listens to events sent with .trigger. | |
dom events will not be listened for. To avoid confusion, you probably shouldn't use this on dom elements. | |
var e = new Events(); | |
e.on("eventname", callbackFunc); // add event listener | |
e.off("eventname", callbackFunc); // rm event listener |
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
/** | |
* splitText - function to split words into html elements based on words and characters | |
* @param html text to split | |
* @param options optional parameters | |
* @example splitText('some text', { | |
* wordClass: 'word', | |
* charClass: 'char', | |
* chars: true, | |
* }) |