_get_project_names(){ local cur prev base COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" local names=$(for x in `ls -d1 /Users/$USER/Projects/*`; do echo ${x/\/Users\/$USER\/Projects\//} ; done) COMPREPLY=( $(compgen -W "${names}" -- ${cur}) )
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
Beelzebub:~ Rodreegez$ mkdir dir1 | |
Beelzebub:~ Rodreegez$ touch dir1/1 | |
Beelzebub:~ Rodreegez$ touch dir1/2 | |
Beelzebub:~ Rodreegez$ touch dir1/3 | |
Beelzebub:~ Rodreegez$ touch dir1/4 | |
Beelzebub:~ Rodreegez$ mkdir dir2 | |
Beelzebub:~ Rodreegez$ cp dir1/* dir2/ | |
Beelzebub:~ Rodreegez$ ls dir1 | |
1 2 3 4 | |
Beelzebub:~ Rodreegez$ ls dir2 |
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
--- | |
sync: | |
directory: /Users/Rodreegez/Projects/scratch/hydra_test | |
exclude: | |
- tmp | |
- log | |
- doc | |
workers: | |
- | |
runners: 2 |
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
wkst-150:hydra_test Rodreegez$ time RAILS_ENV=test rake hydra | |
(in /Users/Rodreegez/Projects/scratch/hydra_test) | |
1292348265.678 MASTER| Initialized | |
1292348265.67811 MASTER| Files: (["test/unit/1_test.rb", "test/unit/10_test.rb", "test/unit/7_test.rb", "test/unit/9_test.rb", "test/unit/8_test.rb", "test/unit/6_test.rb", "test/unit/3_test.rb", "test/unit/2_test.rb", "test/unit/5_test.rb", "test/unit/4_test.rb", "test/functional/tags_controller_test.rb", "test/functional/blog_posts_controller_test.rb", "test/functional/authors_controller_test.rb", "test/unit/author_test.rb", "test/unit/helpers/blog_posts_helper_test.rb", "test/unit/helpers/tags_helper_test.rb", "test/unit/blog_post_test.rb", "test/unit/tag_test.rb", "test/unit/helpers/authors_helper_test.rb"]) | |
1292348265.67816 MASTER| Workers: ([{"type"=>"local", "runners"=>2}, {"directory"=>"/Users/mint/Projects/hydra_test", "connect"=>"mini", "type"=>"ssh", "runners"=>2}]) | |
1292348265.67818 MASTER| Verbose: (true) | |
Hydra Testing [> |
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 nocompatible " Must come first because it changes other options. | |
call pathogen#runtime_append_all_bundles() " Pathogen | |
runtime macros/matchit.vim " ruby text blocks | |
syntax enable | |
set background=dark | |
colorscheme solarized |
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 'fog' | |
con = Fog::Storage.new( | |
provider: 'AWS', | |
aws_secret_access_key: 'ABC123', | |
region: 'eu-west-1', | |
aws_access_key_id: 'ABC123' | |
) | |
=> Fog::AWS::Storage object |
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
# my_array is an array of arrays | |
if my_array.any? | |
my_array.each do |my_sub_array| | |
if my_sub_array.any? | |
my_sub_array.each do |my_thing| | |
my_thing.do_something | |
end | |
end | |
end | |
end |
via Gregory Brown (@seacreature) on Twitter:
Wrong way to deal with the 1.9.2 removal of . from the loadpath:
require "./foo/bar"
forces you to run code from your project root$LOAD_PATH.unshift(".")
recreates security issue, and pollutes
Right way to deal with the 1.9.2 removal of . from the loadpath:
require_relative "foo/bar"
if you don't need Ruby 1.8 compatibility
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
trigger_app GET /apps/:id/trigger(.:format) apps#trigger | |
app_hooks GET /apps/:app_id/hooks(.:format) hooks#index | |
POST /apps/:app_id/hooks(.:format) hooks#create | |
new_app_hook GET /apps/:app_id/hooks/new(.:format) hooks#new | |
edit_app_hook GET /apps/:app_id/hooks/:id/edit(.:format) hooks#edit | |
app_hook GET /apps/:app_id/hooks/:id(.:format) hooks#show | |
PATCH /apps/:app_id/hooks/:id(.:format) hooks#update | |
PUT /apps/:app_id/hooks/:id(.:format) hooks#update | |
DELETE /apps/:app_id/hooks/:id(.:format) hooks#destroy | |
apps GET /apps(.:format) apps#index |
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
#!/bin/bash | |
# Usage: | |
# | |
# $ gemfile sinatra | |
# $ cat Gemfile | |
# source 'https://rubygems.org' | |
# gem 'sinatra' | |
function gemfile { |