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
| inoremap <silent> <Bar> <Bar><Esc>:call <SID>align()<CR>a | |
| function! s:align() | |
| let p = '^\s*|\s.*\s|\s*$' | |
| if exists(':Tabularize') && getline('.') =~# '^\s*|' && (getline(line('.')-1) =~# p || getline(line('.')+1) =~# p) | |
| let column = strlen(substitute(getline('.')[0:col('.')],'[^|]','','g')) | |
| let position = strlen(matchstr(getline('.')[0:col('.')],'.*|\s*\zs.*')) | |
| Tabularize/|/l1 | |
| normal! 0 | |
| call search(repeat('[^|]*|',column).'\s\{-\}'.repeat('.',position),'ce',line('.')) |
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
| #!/bin/sh -e | |
| # | |
| # Usage: browser | |
| # pipe html to a browser | |
| # e.g. | |
| # $ echo '<h1>hi mom!</h1>' | browser | |
| # $ ron -5 man/rip.5.ron | browser | |
| if [ -t 0 ]; then | |
| if [ -n "$1" ]; then |
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
| # Basic tagging system for mongoid documents. | |
| # jpemberthy 2010 | |
| # | |
| # class User | |
| # include Mongoid::Document | |
| # include Mongoid::Document::Taggable | |
| # end | |
| # | |
| # @user = User.new(:name => "Bobby") | |
| # @user.tag_list = "awesome, slick, hefty" |
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
| # ... | |
| # append following lines | |
| Dir[ File.join(File.dirname(__FILE__), 'tasks', '*.rake') ].sort.each do |f| | |
| load f | |
| end |
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
| scala> :power | |
| ** Power User mode enabled - BEEP BOOP ** | |
| ** scala.tools.nsc._ has been imported ** | |
| ** New vals! Try repl, global, power ** | |
| ** New cmds! :help to discover them ** | |
| ** New defs! Type power.<tab> to reveal ** | |
| scala> val s = repl.stringToCompilerType("scala.Some") | |
| s: repl.compiler.Type = object Some |
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
| file 'Gemfile', <<-GEMS | |
| source 'http://gemcutter.org' | |
| gem "rails", "3.0.0.rc1" | |
| gem "bson_ext" | |
| gem "mongoid", "2.0.0.beta.12" | |
| gem "haml", ">= 3.0" | |
| gem "compass", "0.10.0.rc4" | |
| group :test do | |
| gem "rspec-rails", ">= 2.0.0.beta.12" |
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
| # todo: grap topic changes | |
| use strict; | |
| use vars qw($VERSION %IRSSI); | |
| use Irssi; | |
| $VERSION = '0.0.3'; | |
| %IRSSI = ( | |
| authors => 'Thorsten Leemhuis', | |
| contact => '[email protected]', |
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 :cowboy do | |
| desc 'Deploy without SCM' | |
| task :default do | |
| deploy_stage = fetch(:stage, 'none') | |
| set :repository, "." | |
| set :deploy_via, :copy | |
| set :scm, :none | |
| set :stage, deploy_stage | |
| set :cowboy_deploy, true | |
| set :copy_exclude, [".git/*", ".svn/*", "log/*", "vendor/bundle/*"] |
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 "xpath" # XPath is a separate gem now | |
| module Cucumber | |
| module Rails | |
| module CapybaraSelectDatesAndTimes | |
| def select_date(field, options = {}) | |
| date = Date.parse(options[:with]) | |
| selector = %Q{.//fieldset[contains(./legend, "#{field}")]} | |
| within(:xpath, selector) do | |
| find(:xpath, '//select[contains(@id, "_1i")]').find(:xpath, ::XPath::HTML.option(date.year.to_s)).select_option |
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
| I am the owner of lvh.me. And I'm glad to hear it's helpful. In truth, it's just a fancy DNS trick. lhv.me and all of it's sub-domains just point back to your computer (127.0.0.1). That means running ssl is as simple (or difficult) as running ssl on your computer. | |
| I'm not sure how comfortable you are with the command line, but here's my how I setup my development environment. (rvm, passenger, nginx w/ SSL, etc). | |
| # Install rvm (no sudo!) | |
| # ------------------------------------------------------ | |
| bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head ) | |
| source ~/.rvm/scripts/rvm | |
| rvm install ree-1.8.7-2010.02 |
OlderNewer