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
// custom RegEx Class | |
// let string: String = "foo bar baz" | |
// let regex: Regex = "foo" | |
// regex.match(string) // true | |
// "foo".match(string) // true | |
// "foo bar baz" =~ "foo" // 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
function init(config) { | |
var util = require('app/util') | |
, render = require('client/lib/render') | |
, router = require('client/lib/router') | |
, controllers = config.controllers | |
controllers.forEach(function (c) { | |
require(c) | |
}) | |
} |
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 ($) { | |
$.ender({ | |
delay: function (n) { | |
var mock = {} | |
, chain = [] | |
, key | |
, $el = $(this) | |
for (key in $el) { | |
if (isFinite(key)) continue | |
!function (key) { |
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 express = require('express') | |
, app = express.createServer() | |
require('./config/routes').initialize(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
!function (name, definition) { | |
if (typeof define == 'function' && define.amd) define(name, definition) | |
else if (typeof module != 'undefined') module.exports = definition() | |
else this[name] = definition() | |
}('thing', function () { | |
// codes | |
return module | |
}) |
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
ender build backbone |
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 parallel() { | |
var args = Array.apply(null, arguments) | |
, callback = args.pop() | |
, returns = [] | |
, len = 0 | |
args.forEach(function (el, i) { | |
el(function () { | |
var a = Array.apply(null, arguments) | |
, e = a.shift() | |
if (e) return callback(e) |
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 connect = require('connect') | |
, app = require('./app') | |
, app2 = require('./app2') | |
connect( | |
connect.vhost('dustindiaz.com', app) | |
, connect.vhost('foobar.dustindiaz.com', app2) | |
).listen(3000) |
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
test_script_elem = document.createElement("script"), | |
explicit_preloading = typeof test_script_elem.preload == "boolean", | |
real_preloading = explicit_preloading || (test_script_elem.readyState && test_script_elem.readyState == "uninitialized"), | |
script = document.createElement('script') | |
if (real_preloading) { | |
registry_item.elem = script; | |
if (explicit_preloading) { |
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
<script src="ender.min.js"></script> | |
<script> | |
$.require('/js/core.min.js', 'core') | |
$.ready('core', function () { | |
$(document).ready(function () { | |
$('<p>hello world</p>').appendTo('body') | |
.bind('click', function (e) { | |
$.require('/js/ajax.min.js', function () { |
NewerOlder