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
#define @fetch in your initializer. | |
fetch: (options) -> | |
options.success = => | |
@fetching[@url] = undefined | |
options.error = => | |
@fetching[@url] = undefined | |
if JSON.stringify(@fetching[@url]) == JSON.stringify(options) | |
console.log "old fetch in progress for #{@url}" | |
else |
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
module ApplicationHelper | |
blocks = Hash.new() | |
def block(name, *args) | |
value = nil | |
buffer = with_output_buffer { value = yield(*args) } | |
blocks[name] = buffer | |
puts blocks | |
buffer = "<a href='http://google.com'>yo</a>" | |
end | |
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
-- switcher's setLayer args are (layername, shotname) | |
-- layername can be "text" (aka title) "foreground" "normal" "background" "audio" | |
-- Defaults for buttons | |
script button | |
on top(channelnumber) | |
my switcher's setLayer("normal", "cam" & channelnumber & "+cg") | |
my switcher's setLayer("foreground", "Blank Shot") | |
my switcher's go() |
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
twitter - | |
link- | |
<a href="https://twitter.com/vidpresso" class="twitter-follow-button" data-show-count="false">Follow @vidpresso</a> | |
setup- | |
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script> | |
FB - |
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
if dataSource | |
log "found data" | |
currentItem = externalData[dataSource.bind].current | |
if !currentItem? | |
break | |
else | |
renderData = currentItem.toJSON() | |
else if @model.get "default" | |
log "found default" | |
renderData = @model.get "default" |
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 = {} | |
exports.setup = (newApp) -> | |
app = newApp | |
exports.routes = | |
"/": | |
get: (req, res, next) -> | |
res.redirect "/displays/ksl" | |
"/:param": | |
get: (req, res, next) -> | |
res.render "display" |
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
exports.Collection = class Posts extends Backbone.Collection | |
initialize: (models, options) => | |
@id = options.id | |
@activeDetails = false | |
@on "loadDetails", @loadDetails | |
@on "detailsLoaded", @logger | |
debug "initialized posts" | |
@fetch | |
beforeSend: () => | |
console.log "about to fetch..." |
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
exports.Item = class PostView extends Backbone.View | |
template: require "../templates/post.jade" | |
events: | |
"click" : "loadDetails" | |
render: () => | |
debug @model.toJSON() | |
$(@el).html(@template @model.toJSON()) | |
@ | |
loadDetails: () => |
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
var htmler, m, p, queryString, re1, re2, re3, re4, re5, re6, re7, txt; | |
txt = "56 East 7720 S, Midvale UT 84047"; | |
txt = "268 Park St, Midvale UT 84047"; | |
htmler = ""; | |
re1 = '(.*?),'; |
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
#txt = $("h1.street-address").text() #fron Trulia | |
txt = "56 East 7720 S, Midvale UT 84047" #bad | |
txt = "268 Park St, Midvale UT 84047" #good | |
htmler = "" | |
re1='(.*?),' | |
re2='.*?' | |
re3='((?:[a-z][a-z]+))' | |
re4='.*?' | |
re5='((?:(?:AL)|(?:AK)|(?:AS)|(?:AZ)|(?:AR)|(?:CA)|(?:CO)|(?:CT)|(?:DE)|(?:DC)|(?:FM)|(?:FL)|(?:GA)|(?:GU)|(?:HI)|(?:ID)|(?:IL)|(?:IN)|(?:IA)|(?:KS)|(?:KY)|(?:LA)|(?:ME)|(?:MH)|(?:MD)|(?:MA)|(?:MI)|(?:MN)|(?:MS)|(?:MO)|(?:MT)|(?:NE)|(?:NV)|(?:NH)|(?:NJ)|(?:NM)|(?:NY)|(?:NC)|(?:ND)|(?:MP)|(?:OH)|(?:OK)|(?:OR)|(?:PW)|(?:PA)|(?:PR)|(?:RI)|(?:SC)|(?:SD)|(?:TN)|(?:TX)|(?:UT)|(?:VT)|(?:VI)|(?:VA)|(?:WA)|(?:WV)|(?:WI)|(?:WY)))(?![a-z])' |