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
namespace :deploy do | |
namespace :assets do | |
task :precompile, :roles => :web, :except => { :no_release => true } do | |
precompile_command = %Q{cd #{latest_release} && #{rake} RAILS_ENV=#{rails_env} #{asset_env} assets:precompile} | |
if remote_file_exists?("#{current_path}/REVISION") | |
from = source.next_revision(current_revision) | |
if capture("cd #{latest_release} && #{source.local.log(from)} vendor/assets/ app/assets/ | wc -l").to_i > 0 | |
run precompile_command | |
else |
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
# A way to interact with the NS (Dutch Railways) API | |
# | |
# To configure, add NS_API_EMAIL and NS_API_PASSWORD to your Heroku config with "heroku config:add" | |
# | |
# train disruptions <station> - Retrieve the list of disruptions near <station>. | |
# Please note: <station> can be a station code (e.g. 'asd') | |
# or (part of) a station name (e.g. 'Amsterdam Centraal') | |
# | |
disruptionPageRoot = 'http://www.ns.nl/storingen/index.form#' | |
module.exports = (robot) -> |
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
machine git.hostname.com | |
login johndoe | |
password supersecret |
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
en_gb: &definitions | |
cake: lie | |
huge: success | |
en_us: | |
<<: *definitions |
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 ItemsController < ApplicationController | |
include JsonParams | |
def index | |
@items = Item.all | |
respond_to do |format| | |
format.json { render :json => @items.to_json } | |
end | |
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
" | |
" APIdock search for word under cursor | |
" | |
let g:browser = 'open -a /Applications/Google\ Chrome.app ' | |
" On OSX - let g:browser = 'open -a /Applications/Firefox.app' | |
" Open the Ruby ApiDock page for the word under cursor, in a new Firefox tab | |
function! OpenRubyDoc(keyword) | |
let url = 'http://apidock.com/ruby/search/quick?query='.a:keyword | |
exec '!'.g:browser.' '.url.' &' |
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
function! RemoveTrailingWhiteSpaces() | |
" Remove ALL trailing whitespaces | |
%s/\s\+$// | |
endfunction | |
noremap WW :call RemoveTrailingWhiteSpaces()<CR> |
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
require 'worker' | |
require 'resque/tasks' |
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
# In lib/query/base_query.rb | |
# | |
def to_params | |
params = {} | |
if @keywords | |
params[:q] = @keywords | |
params[:fl] = '* score' | |
params[:fq] = types_phrase | |
params[:qf] = text_field_names.join(' ') | |
params[:defType] = 'dismax' |
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
namespace :csv do | |
desc "Makes sure all rows have a trailing ;" | |
task :cleanup do | |
file, new_file = ENV['FILE'], ENV['NEWFILE'] | |
raise "Provile valid FILE and NEWFILE, e.g. FILE=./lib/prospects.csv" unless file or new_file | |
lines, new_file = File.open(file), File.open(new_file, 'wb') | |
lines.each_line do |line| | |
unless line.strip.last == ";" | |
line = line.strip + ";#{$/}" |