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.addBehaviors({ | |
".popup button.nevermind":function(){ | |
this.up('.popup').hide(); | |
return false; | |
}, | |
"button.nevermind":function(){ | |
window.location.back(); | |
} | |
}); |
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.addBehavior { | |
"form.register:submit": (event) -> | |
Event.stop event | |
@request { | |
onSuccess: => | |
@update 'Splendid, we’ve got you down for an invite.' | |
} | |
} |
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
Sailormoon.observe { | |
"a[sigil=login]:click": (event) -> | |
new Sailormoon.Views.LoginWindow(event) | |
false | |
"a[sigil=signup]:click": (event) -> | |
new Sailormoon.Views.Signup(event) | |
false | |
} |
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
valid = _.reduce _.invoke(jQ(this).find('input'),'val'), (memo, num) -> | |
return num.length unless num.length > 5 | |
memo is num | |
if typeof valid is 'number' | |
# too short | |
else if valid isnt yes | |
# not matching |
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
./configure --enable-debian \ | |
--with-acls \ | |
--with-ssl-dir=/usr/include/openssl \ | |
--enable-dropkludge \ | |
--with-cracklib=/usr/share/cracklib/cracklib-small \ | |
--with-libgcrypt-dir=/usr/lib |
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
// As a param | |
$.ajax({ | |
url: "/api/v1/kittens", | |
parameters: {name: "Sillycat", breed: "Tiger", token: "4815162342"}, | |
success: function(){ | |
// kitten created | |
} | |
}); |
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
# | |
# Halftoneapp.com Sample Bluepill Configuration File | |
# Read more at: http://blog.halftoneapp.com | |
# | |
# Set paths | |
home_dir = "/home/railsapp" | |
rails_shared = "#{home_dir}/app/shared" | |
unicorn_path = "/path/to/unicorn_rails" |
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
Endor.Utils.formatLinks = (content) -> | |
safeContent = Handlebars.Utils.escapeExpression(content) | |
safeContent = safeContent.replace LINK_DETECTION_REGEX, (url) -> | |
address = if /[a-z]+:\/\//.test url then url else "http://#{url}" | |
"<a href='#{address}' target='_blank'>#{url}</a>" | |
new Handlebars.SafeString(safeContent) # Mark our string as safe, since it is. |
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
location / { | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host $http_host; | |
proxy_set_header X-NginX-Proxy true; | |
proxy_pass http://lotr/; | |
proxy_redirect off; | |
} |
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
_.cycle = (arr) -> | |
-> | |
arr.push arr.shift() | |
arr[0] |