Name | Key | Url |
---|---|---|
Google 翻訳 | t | http://translate.google.co.jp/?source=osdd#auto |
google map | m | http://maps.google.co.jp/maps?oi=map&q=%s |
Github | g | http://github.com/search?q=%s |
Amazon | a | http://www.amazon.co.jp/gp/search?field-keywords=%s&index=blended&__mk_ja_JP=%E3%82%AB%E3%82%BF%E3%82%AB%E3%83%8A |
alc | e | http://eow.alc.co.jp/%s/utf-8/ |
qiita.com | q | http://qiita.com/search?utf8=%E2%9C%93&q=%s&commit=%E6%A4%9C%E7%B4%A2 |
Stack Overflow | s | http://stackoverflow.com/search?q=%s |
# Sublime Text 3 languages list: | |
ls -1 /Applications/Sublime\ Text.app/Contents/MacOS/Packages/ | |
# Remove all default Sublime Text 3 snippets for Python language | |
export ST3_LANG="Python" | |
mkdir -p ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/$ST3_LANG/ | |
unzip -l /Applications/Sublime\ Text.app/Contents/MacOS/Packages/$ST3_LANG.sublime-package | grep '.sublime-snippet' | awk '{print $4}' | while read f; do touch ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/$ST3_LANG/$f; done | |
unset ST3_LANG |
inputs = %w[ | |
CollectionSelectInput | |
DateTimeInput | |
FileInput | |
GroupedCollectionSelectInput | |
NumericInput | |
PasswordInput | |
RangeInput | |
StringInput | |
TextInput |
(function(){ | |
var total = {}; | |
var year = '2012'; | |
var all = false; | |
function init(num) { | |
if(typeof num !== 'number') { | |
num = 0; | |
$('<div/>').css({ | |
position: 'fixed', | |
left: 0, |
# Add this to the end of your development.rb and add | |
# | |
# gem 'pry' | |
# | |
# to your Gemfile and run bundle to install. | |
silence_warnings do | |
begin | |
require 'pry' | |
IRB = Pry |
With the introduction of Phusion Passenger Standalone, some of the established wisdom with regards to Capistrano tasks for managing Passenger are a tad outdated.
In particular, the start
and stop
tasks for Passenger are typically NOOPs, and only the restart
task is deemed relevant. This is arguably no longer the case for standalone Passenger, where start
and stop
tasks do make sense, as they did back in the mongrel days.
The following Capistrano tasks illustrate how to start, stop and restart a standalone Passenger setup.
These tasks are for a Passenger setup that uses Unix domain sockets, but they can easily be modified for Passenger instances configured for TCP sockets.
namespace :deploy do
task :start, :roles => :app, :except => { :no_release => t
These are some of my (Ryan Bates) favorite gems to use for various tasks:
- JavaScript: jQuery with jquery-rails
- Pagination: Kaminari
- Testing: RSpec, Cucumber and Capybara
- Factories: Factory Girl
- Authentication: Nifty Generators and Omniauth
- Authorization: CanCan
- File Attachments: Carrierwave
- HTML/XML Parsing: Nokogiri
# Run: curl https://gist.github.com/raw/719970/locale_diff.rb | ruby - en fi | |
require 'rubygems' | |
require 'yaml' | |
l1 = ARGV[0] | |
l2 = ARGV[1] | |
first = YAML.load_file(l1 + ".yml") | |
second = YAML.load_file(l2 + ".yml") | |
def diff(root, compared, structure = []) |
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |