Skip to content

Instantly share code, notes, and snippets.

@yctay
yctay / deploy.rb
Created October 7, 2012 20:05 — forked from uhlenbrock/deploy.rb
Precompile assets locally for Capistrano deploy
load 'deploy/assets'
namespace :deploy do
namespace :assets do
desc 'Run the precompile task locally and rsync with shared'
task :precompile, :roles => :web, :except => { :no_release => true } do
%x{bundle exec rake assets:precompile}
%x{rsync --recursive --times --rsh=ssh --compress --human-readable --progress public/assets #{user}@#{host}:#{shared_path}}
%x{bundle exec rake assets:clean}
end
@yctay
yctay / memusage.rb
Created October 7, 2012 16:04 — forked from taiansu/memusage.rb
WebFaction Memory Usage Script
#!/usr/bin/env ruby
# Memory usage script for WebFaction customers adapted to attempt to
# draw username from the pwd
# Nick Trew <[email protected]>
# 2009-05-25
# START CONFIG #
require 'pathname'
@yctay
yctay / all_locale_switcher.html.erb
Created October 3, 2012 10:05
RefineryCMS frontend locale switcher
<!-- Locale switchers, but presents all available locales as options, even the presently active one -->
<ul>
<% Refinery::I18n.config.frontend_locales.each do |locale| %>
<li>
<%= link_to "/#{locale.to_s + request.path}", {:title => Refinery::I18n.locales[locale]} do%>
<span><%= Refinery::I18n.locales[locale] %></span>
<% end -%>
</li>
<% end %>
@yctay
yctay / Gemfile
Created October 3, 2012 09:00 — forked from simi/Gemfile
Refinery + Twitter Bootstrap WIP
source 'https://rubygems.org'
gem 'rails', '3.2.1'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
@yctay
yctay / gist:2873139
Created June 5, 2012 06:43
Simple Timer Controls, with Bootstrap v2 CSS styles
<!-- Le CSS
============================== -->
<link href="https://raw.github.com/twitter/bootstrap/master/docs/assets/css/bootstrap.css" rel="stylesheet" type="text/css">
<!-- Le HTML
============================== -->
<div class="btn-group" id="timer-controls">
<a class="btn btn-success" id="timer-start" style="padding-left:47px;padding-right:48px;"><i class="icon-play icon-white"></i>&nbsp;Start</a>
</div>
@yctay
yctay / gist:2503347
Created April 26, 2012 21:25 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt