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
CarouselDemoCtrl = ($scope) -> | |
$scope.myInterval = 5000 | |
slides = $scope.slides = [] | |
$scope.addSlide = -> | |
newWidth = 600 + slides.length | |
slides.push | |
image: "http://placekitten.com/" + newWidth + "/300" | |
text: [ | |
"More" | |
"Extra" |
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
// Lovely simple-to-read code: | |
function handleDelete(request, response) { | |
getBlogByGuid(request.url.query.guid, function gotBlog(err, blog) { | |
deleteDocumentById(blog.id, function deletedBlog(err, status) { | |
// Deleted OK | |
response.writeHead(200); | |
response.end('Blog Deleted'); | |
}) | |
}); |
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
# unicorn_rails -c /data/github/current/config/unicorn.rb -E production -D | |
rails_env = ENV['RAILS_ENV'] || 'production' | |
# 16 workers and 1 master | |
worker_processes (rails_env == 'production' ? 16 : 4) | |
# Load rails+github.git into the master before forking workers | |
# for super-fast worker spawn times | |
preload_app 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
// Place your application-specific JavaScript functions and classes here | |
// This file is automatically included by javascript_include_tag :defaults | |
$(function() { | |
MIN_ANSWERS = 2 | |
MAX_ANSWERS = 10 | |
MIN_ANSWERS_MSG = "Minimum of two(2) answers required." | |
MAX_ANSWERS_MSG = "Maximum of ten(10) answers only." | |
TOP_ANSWER_MSG = "Can't go up answer is on the top list." |
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 < Sinatra::Default | |
def protected! | |
pass unless authorized? | |
end | |
get '/this_is_protected' do | |
protected! | |
end |
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
// This version works | |
$('#account_info_form').submit(function() { | |
$.facebox(function() { | |
$("#account_info_form").ajaxSubmit(function(respText, statusText) { | |
$.facebox((statusText == "success")?"Account Information successfully update": | |
"Failed to update Account Information."); | |
}) | |
}); | |
return false; | |
}); |