This file contains hidden or 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
App.stateManager = Ember.StateManager.create({ | |
//Swap state within this element | |
rootElement: "#appRoot", | |
//Simple State | |
overview: Ember.ViewState.create({ | |
view: App.Overview | |
}), |
This file contains hidden or 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
/* Director's routes config | |
routes that have segments that start with colons, | |
like /lists/:listType, will pass in the variable to | |
the callback. | |
*/ | |
var routes = { | |
'/app': function() { | |
; |
This file contains hidden or 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 is an incredibly fun and (relatively) easy language. It's also | |
really easy to do badly... in some ways js is out to get you, so if you're | |
ready for it, you can avoid the pitfalls and have a great time. | |
Ideally this talk gets you thinking of Javascript as the unique, | |
quasi-dangerous little beast that is. If you respect the ways in which it | |
is your enemy, it will become one of your best friends. | |
This presentation isn't intended to teach javascript (though you'll probably |
This file contains hidden or 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
require 'rubygems' | |
require 'sinatra' | |
require 'json' | |
mime_type :manifest, 'text/cache-manifest' | |
get '/*.*' do | |
#content_type :manifest | |
send_file('./' + params[:splat].join('.')) | |
end |
This file contains hidden or 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
$BV.configure("global", { | |
... old stuff ..., | |
onEvent: function(json) { | |
if (json.bvProduct === "Stories" && eType === "Read") { | |
//your resize function for SY | |
} else if (json.bvProduct === "RatingsAndReview" && eType === "Read") { | |
// your resize function for RR | |
} | |
} |
This file contains hidden or 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
> npm install . -g | |
#check to see if everything is working | |
> watchjs | |
Starting server on... #great |
This file contains hidden or 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
#!/usr/bin/env node | |
var app = require('../watch'); | |
var static_dir = '.'; | |
if (process.argv.length > 2) { | |
static_dir = process.argv[2]; | |
} | |
app.init(static_dir); |
This file contains hidden or 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
{ | |
"name": "watch.js", | |
"description": "A script and stylesheet reloader. Less browser refreshing.", | |
"version": "0.0.5", | |
"author": "Mark DiMarco (@markmarkoh)", | |
"engines": { | |
"node": ">= 0.4.0" | |
}, | |
"dependencies": { | |
"socket.io": "0.7.7" |
This file contains hidden or 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 tocWrapper = $("#toc .wrapper"); | |
$("#mainContainer h1").each(function(i,item) { | |
$("<a />") | |
.text( $(item).text() ) | |
.attr("href","#") | |
.data("scrollTo",item) |
This file contains hidden or 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
//In Javascript, a Regex object can be called like a function | |
//like: /test/("is test in here") | |
searchText = "padding 1234 rocket str austin TX 78704 more padding" | |
/\d+.+\n{0,2}.+\s+[A-Z]{2}\s+\d{5}/m(searchText) | |
//returns: ["1234 rocket str austin TX 78704"] | |
//As opposed to the more verbose(but sometimes more appropriate in cases that you are reusing the Regex): |