- http://tutsplus.com/tutorial/writing-modular-javascript/
- https://github.com/aranm/scalable-javascript-architecture
- https://github.com/patrick99e99/scalable-js-architecture-app
- http://scaleapp.org/
- http://addyosmani.com/largescalejavascript/
- https://github.com/tcorral/Hydra.js/
- http://alanlindsay.me/kerneljs/
- http://terrifically.org/
- https://github.com/gorillatron/cerebral
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
// JS Module Pattern: | |
// http://j.mp/module-pattern | |
// Redefine: $, window, document, undefined. | |
var APP = (function($, window, document, undefined) { | |
// Automatically calls all functions in APP.init | |
$(document).ready(function() { | |
APP.go(); | |
}); |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<scheme name="Blackbored" version="1" parent_scheme="Default"> | |
<option name="LINE_SPACING" value="1.25" /> | |
<option name="EDITOR_FONT_SIZE" value="12" /> | |
<option name="EDITOR_FONT_NAME" value="Monaco" /> | |
<colors> | |
<option name="ANNOTATIONS_COLOR" value="3e83e7" /> | |
<option name="CARET_COLOR" value="" /> | |
<option name="CARET_ROW_COLOR" value="40436" /> | |
<option name="CONSOLE_BACKGROUND_KEY" value="0" /> |
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
/*! | |
* JavaScript detach - v0.2 - 5/18/2011 | |
* http://benalman.com/ | |
* | |
* Copyright (c) 2011 "Cowboy" Ben Alman | |
* Dual licensed under the MIT and GPL licenses. | |
* http://benalman.com/about/license/ | |
*/ | |
function detach(node, async, fn) { |
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 selectKeys = function(hash, keys) { | |
var output, prop, index; | |
output = {}; | |
if(!keys) return {}; | |
if(keys instanceof Array) { | |
for(index = 0; index < keys.length; index++) { | |
output[keys[index]] = hash[keys[index]]; | |
} | |
return output; |
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
if (typeof (AC) === "undefined") { | |
AC = {} | |
} | |
AC.ImageReplacer = Class.create({ | |
_defaultOptions: { | |
listenToSwapView: true, | |
filenameRegex: /(.*)(\.[a-z]{3}($|#.*|\?.*))/i, | |
filenameInsert: "_☃x", | |
ignoreCheck: /(^http:\/\/movies\.apple\.com\/|\/105\/|\/global\/elements\/quicktime\/|_(([2-9]|[1-9][0-9]+)x|nohires)(\.[a-z]{3})($|#.*|\?.*))/i, | |
attribute: "data-hires", |
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
(extend-type js/RegExp | |
cljs.core/IFn | |
(-invoke ([this s] (re-matches this s)))) | |
(#"foo.*" "foobar") ;=> "foobar" | |
(#"zoo.*" "foobar") ;=> nil | |
(filter #".*foo.*" ["foobar" "goobar" "foobaz"]) ;=> ("foobar" "foobaz") |
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
class MyApp.Router extends Backbone.Router | |
hasPushState: window.history and window.history.pushState | |
# Override the navigate function to remove Backbone's #hash fallback for | |
# non-pushState browsers. Instead we just navigate to the new location using | |
# window.location | |
navigate: (fragment, trigger) -> | |
if @hasPushState | |
super(arguments...) |
A short list of hurdles to get Electron working more like Node, and how I'm tackling them.
- using renderer
process.stdin
with Buffer seems difficult/impossible- alternative: send buffered stdin as a string to the renderer
- renderer
process.argv
needs to berequire('remote').process.argv
- should be patched in preload script to ensure your Node dependencies work correctly
- syntax errors in
<script src="index.js">
do not print to terminalwindow.onerror
in a preload script can be used to detect these problems- only provides file, line number and a minimal error message
- stderr gets cluttered with Chromium logs