In your shell:
cd ~/.vim
git clone git://github.com/juvenn/mustache.vim.git
mv mustache.vim/syntax/* syntax/
mv mustache.vim/indent/* indent/
mv mustache.vim/ftdetect/* ftdetect/
rm -rf mustache.vim
namespace :deploy do | |
namespace :assets do | |
desc 'Run the precompile task locally and rsync with shared' | |
task :precompile, :roles => :app, :except => { :no_release => true } do | |
system("bundle check"); exit if $? != 0 | |
system("RAILS_ENV=#{stage} bundle exec rake assets:precompile"); exit if $? != 0 | |
servers = find_servers :roles => :web, :except => { :no_release => true } | |
run <<-CMD.compact | |
cp -- #{shared_manifest_path.shellescape} #{current_path.to_s.shellescape}/assets_manifest#{File.extname(shared_manifest_path)} | |
CMD |
def suppress_prompt(text) | |
page.evaluate_script 'window.original_prompt_function = window.prompt;' | |
page.evaluate_script "window.prompt = function(msg) { return '#{text}'; }" | |
end | |
def recover_prompt | |
page.evaluate_script('window.prompt = window.original_prompt_function;') | |
end |
$ = jQuery | |
class AjaxModel extends Spine.Model | |
@configure "AjaxModel" ,"data" | |
@updateOrder : -> | |
url = "http://search.twitter.com/search.json?callback=?" | |
query = q :escape("javascript") | |
$.getJSON(url,query,(d)=> | |
AjaxModel.create({data:d}) |
# Apparently, I am really 'en fuego' today. | |
require 'test/unit' | |
module RubyRegexMeister | |
BALANCED_GROUP_CHECKER = /( | |
(?<non_grouping_char> | |
[^\(\{\[\<\)\}\]\>] | |
){0} | |
(?<parens_group> |
su - | |
#dependcies | |
#centos 6.2 | http://mirrors.ustc.edu.cn/fedora/epel/6/x86_64/epel-release-6-7.noarch.rpm | |
rpm -Uvh http://mirrors.ustc.edu.cn/fedora/epel/5/x86_64/epel-release-5-4.noarch.rpm | |
yum -y groupinstall 'Development Tools' 'Additional Development' | |
yum -y install readline readline-devel ncurses-devel gdbm-devel glibc-devel tcl-devel openssl-devel curl-devel expat-devel db4-devel byacc sqlite-devel gcc-c++ libyaml libyaml-devel libffi libffi-devel libxml2 libxml2-devel libxslt libxslt-devel libicu libicu-devel system-config-firewall-tui python-devel redis |
#!/bin/sh | |
# | |
cmd=$(which tmux) | |
session=hjue | |
if [ -z $cmd ]; then | |
echo "You need to install tmux." | |
exit 1 | |
fi |
RSpec.configure do |config| | |
config.before(:suite) do | |
DatabaseCleaner.clean_with(:truncation) | |
end | |
config.before(:each) do | |
DatabaseCleaner.strategy = Capybara.current_driver == :rack_test ? :transaction : :truncation | |
DatabaseCleaner.start | |
end |
# 單純用來決定該有哪些 interface 和一些是在我們這邊處理的邏輯 | |
class PaymentGateway | |
attr_reader :email | |
SUBSCRIPTION_AMOUNT = 10.to_money | |
def initialize(user) | |
@email = user.email | |
end |
require 'grape' | |
class API < Grape::API | |
before do | |
@log_start_t = Time.now | |
Rails.logger.info " Parameters: #{params.to_hash.except("route_info")}" | |
end | |
after do | |
@log_end_t = Time.now |
In your shell:
cd ~/.vim
git clone git://github.com/juvenn/mustache.vim.git
mv mustache.vim/syntax/* syntax/
mv mustache.vim/indent/* indent/
mv mustache.vim/ftdetect/* ftdetect/
rm -rf mustache.vim