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
source :rubygems | |
gem 'rake', '0.8.7' | |
gem "retroactive_module_inclusion", "~> 1.2.5" |
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
load 'deploy/assets' |
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
set :deploy_to, "/usr/share/my-app" | |
namespace :play do | |
task :setup do | |
run "mkdir -p #{deploy_to}" | |
upload "my-app/start.sh", "#{deploy_to}/start.sh", :mode => '755', :via => :scp | |
upload "my-app/stop.sh", "#{deploy_to}/stop.sh", :mode => '755', :via => :scp | |
end | |
task :deploy do |
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
track_branches() { | |
# --- Arguments | |
oldrev=$(git rev-parse $1) | |
newrev=$(git rev-parse $2) | |
refname="$3" | |
case "$refname" in | |
refs/heads/*) | |
branch=$(expr "$refname" : "refs/heads/\(.*\)") | |
featurebranch=$(expr "$branch" : "\(.*/.*\)") |
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
<%= form_tag '/trip', :remote => true, :id => 'searchbox' do -%> | |
<div id="main" > | |
<label>Search</label> | |
<%= text_field_tag :text, @text, :id => 'text' %> | |
</div> | |
</div> | |
<% 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
def f(a = "", b = {}, c = "", d = "") | |
puts "a=#{a}" | |
puts "b=#{b}" | |
puts "c=#{c}" | |
puts "d=#{d}" | |
end | |
f(c: "c", d: "d") |
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 Blog.Routers.PostsRouter extends Backbone.Router | |
routes: | |
"posts/:page" : "index" | |
".*" : "index" | |
index: (page) -> | |
pageNumber = page || 1 | |
@posts = new Blog.Collections.PostsCollection() | |
@view = new Blog.Views.Posts.IndexView({model:@posts, page:parseInt(pageNumber)+1}) |
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
<div id="posts"></div> | |
<script type="text/javascript"> | |
$(function() { | |
// Blog is the app name | |
window.router = new Blog.Routers.PostsRouter({posts: <%= @posts.to_json.html_safe -%>}); | |
Backbone.history.start(); | |
}); | |
</script> |
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
package util | |
import org.specs2.mutable.Specification | |
/** | |
* Created by jero on 26-10-15. | |
*/ | |
class FooTest extends Specification{ | |
trait Spec | |
trait Data |
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
import play.api.libs.json._ | |
import play.api.libs.functional.syntax._ | |
import HListUtils._ | |
import JsonFormats._ | |
implicit val specReads = ( | |
(__ \ "id").read[String] and | |
(__ \ "specs").read(( | |
(__ \ "specA").read[SpecA] and |