- Use UTF-8. It’s 21 century, 8bit encodings dead now.
- Use 2 space indent, not tabs
- Use Unix-style line endings
- Keep lines not longer than 80 chars
- Remove trailing whitespace
This file contains hidden or 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 | |
desc 'Bundle and minify the JS and CSS files' | |
task :precache_assets, :roles => :app do | |
root_path = File.expand_path(File.dirname(__FILE__) + '/..') | |
jammit_path = Dir["#{root_path}/vendor/gems/jammit-*/bin/jammit"].first | |
yui_lib_path = Dir["#{root_path}/vendor/gems/yui-compressor-*/lib"].first | |
assets_path = "#{root_path}/public/assets" | |
# Precaching assets | |
run_locally "ruby -I#{yui_lib_path} #{jammit_path}" |
This file contains hidden or 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" if respond_to?(:namespace) # cap2 differentiator | |
DEPLOYMENT_CONFIG = YAML.load_file("./config/config.yml")["production"] | |
# Ref: https://github.com/capistrano/capistrano/issues/81#issuecomment-1994285 | |
require "bundler/capistrano" | |
# Uncomment if you are using Rails' asset pipeline | |
load "deploy/assets" |
This file contains hidden or 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
# Note: This does not yet align 100% with out of the box devise. I will work on that. | |
Feature: Authentication | |
In order to protect my assets stored within a system | |
As any user | |
I would like to be verified as the rightful owner of those assets through authentication | |
Scenario: No authenticated user within the system | |
Given a user exists with email: "[email protected]" | |
And I am not authenticated |
This file contains hidden or 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
# Use the config/mongoid/#{rails_env}.yml file for mongoid config | |
namespace :mongoid do | |
desc "Copy mongoid config" | |
task :copy do | |
upload "config/mongoid/#{rails_env}.yml", "#{shared_path}/mongoid.yml", :via => :scp | |
end | |
desc "Link the mongoid config in the release_path" | |
task :symlink do |
This file contains hidden or 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
!!! 5 | |
%html | |
%head | |
%title= "Your Website" | |
%meta{ :content => "", :name => "description" } | |
%meta{ :content => "", :name => "author" } | |
%meta{ :content => "3 days", :name => "revisit-after" } | |
%link{ :href => "http://creativecommons.org/licenses/by/3.0/", :rel => "license", :title => "Creative Commons Attribution 3.0 Unported License" } | |
%link{ :href => "/feed", :rel => "alternate", :title => "Atom", :type => "application/atom+xml" } | |
%link{ :href => "/css/screen.css", :media => "screen", :rel => "stylesheet" } |
This file contains hidden or 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
# /etc/init/project-web-reload.conf | |
pre-start script | |
initctl restart project-web | |
sleep 15 | |
end script | |
exec /usr/local/rvm/bin/default_bluepill restart |
This file contains hidden or 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 'net/http' | |
require 'xmlsimple' | |
url = "http://www.user-agents.org/allagents.xml" | |
xml_data = Net::HTTP.get_response(URI.parse(url)).body | |
data = XmlSimple.xml_in(xml_data) | |
agents = data['user-agent'].select{|agent| type = agent["Type"].first; type.include?("R") || type.include?("S")} | |
agent_names = agents.collect {|agent| agent["String"].first} |
This file contains hidden or 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
(global-set-key (kbd "C-c p f") 'projectile-find-file) | |
(global-set-key (kbd "C-c p F") 'projectile-find-file-other-window) | |
(global-set-key (kbd "C-c p d") 'projectile-find-dir) | |
(global-set-key (kbd "C-c p D") 'projectile-find-dir-other-window) | |
(global-set-key (kbd "C-c C-c d") 'projectile-dired) | |
(global-set-key (kbd "C-c p b") 'projectile-switch-to-buffer) | |
(global-set-key (kbd "C-c p a") 'projectile-ag) | |
(global-set-key (kbd "C-c p i") 'projectile-invalidate-cache) | |
(global-set-key (kbd "C-c p k") 'projectile-kill-buffers) | |
(global-set-key (kbd "C-c p p") 'projectile-switch-project) |
This file contains hidden or 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
http://tech.pristine.io/android-unit-test-idioms/ | |
http://touk.pl/blog/pl/2014/02/26/mock-retrofit-using-dagger-and-mockito/ | |
https://software.intel.com/en-us/videos/test-driven-development-and-android-testing-by-christopher-perry-and-marcelo-bay-area-android | |
(http://uds.ak.o.brightcove.com/740838651001/740838651001_3482875046001_Android-Fest-Chris-and-Marcello-4-12-14.mp4) | |
https://www.reddit.com/r/androiddev/comments/2mebor/testing_retrofit_observable_with_robolectric/ | |
http://www.slideshare.net/godfreynolan/android-tdd-41783654 | |
http://code.tutsplus.com/tutorials/dependency-injection-with-dagger-2-on-android-- | |
cms-23345 | |
http://code.tutsplus.com/tutorials/quick-tip-using-butter-knife-to-inject-views-on-android--cms-23542 | |
http://square.github.io/ (author of retrofit, dagger) |