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 '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 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 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) |
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
##formtastic_datepicker_interface | |
module Formtastic | |
module DatePicker | |
protected | |
def datepicker_input(method, options = {}) | |
format = options[:format] || ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS[:default] || '%d %b %Y' | |
string_input(method, datepicker_options(format, object.send(method)).merge(options)) | |
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
#!/usr/bin/env ruby | |
# -*- ruby -*- | |
require 'rubygems' | |
require 'daemon-spawn' | |
RAILS_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..')) | |
class DelayedJobWorker < DaemonSpawn::Base | |
def start(args) | |
ENV['RAILS_ENV'] ||= args.first || 'development' |
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 :bundler do | |
task :create_symlink, :roles => :app do | |
shared_dir = File.join(shared_path, 'bundle') | |
release_dir = File.join(current_release, '.bundle') | |
run("mkdir -p #{shared_dir} && ln -s #{shared_dir} #{release_dir}") | |
end | |
task :bundle_new_release, :roles => :app 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
#!/usr/bin/env ruby | |
# | |
# sprockets watch | |
# ------------------------------------------------------ | |
# inspired by Compass from Chris Eppstein | |
# minify and concat code from Mark Story | |
# put together by Kjell Bublitz | |
# using Sprockets! | |
# | |
# sources: |
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
user app; | |
worker_processes 2; | |
error_log /home/app/logs/nginx.error.log info; | |
events { | |
worker_connections 1024; | |
} | |
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
# Application Generator Template | |
# Devise, Cucumber, RSpec... for use with Rails 3 | |
# http://gist.github.com/513564 | |
# Based on the Mongoid/Devise template: http://github.com/fortuity/rails3-mongoid-devise/raw/master/template.rb | |
# | |
# | |
# Installs my js_lib rakefile, found: http://gist.github.com/raw/628715/js_lib.rake | |
# (to keep js libraries out of source control.) | |
# | |
# Usage: |
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
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com | |
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below) | |
module Player | |
describe MovieList, "with optional description" do | |
it "is pending example, so that you can write ones quickly" | |
it "is already working example that we want to suspend from failing temporarily" do | |
pending("working on another feature that temporarily breaks this one") |
OlderNewer