-
This is a numbered list.
-
I'm going to include a fenced code block as part of this bullet:
Code More Code
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 helpers | |
* requires Underscore.js | |
*/ | |
var ApplicationHelpers = { | |
/** | |
* Railsify object's keys to play nice with default Rails controller setup. | |
* Rails default controller setup expects params submitted via PUT / POST as: | |
* | |
* (POST) {'my_model[attr1]' : 'value1', ... etc. } |
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
# encoding: utf-8 | |
require 'rubygems' | |
require 'builder' | |
svg_doctype = [ | |
:DOCTYPE, | |
:svg, | |
:PUBLIC, | |
"-//W3C//DTD SVG 1.1//EN", |
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
# When I posted the results of the Roman Numeral Calculator kata | |
# earlier this week, I said that I felt that the evolution of the code | |
# through TDD was much more interesting than the final result. Let me | |
# explain. | |
# | |
# First, some background. The goal of this Kata is to produce a | |
# RomanNumeralCalculator object that converts from arabic numbers to | |
# Roman numerals, and from Roman numerals back to arabic. | |
Then { calculate("1").should == "I" } |
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
plugin | |
naming convention: name_of_plugin.vim | |
these files are sourced for all file types | |
doc | |
naming convention: name_of_plugin.txt | |
these files document the functionality of a plugin | |
color | |
naming convention: name_of_colorscheme.vim |
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
function! s:ToDoList () | |
cclose | |
let task_list = [] | |
for row in split(system('ack --column "(TODO|CHANGED|FIXME)"'), '\n') | |
let t = split(row, ':') | |
let task_dict = {'filename': t[0], 'lnum': t[1], 'col': t[2]} | |
let task_dict.text = substitute(join(t[3:-1]), '\s\+', ' ', '') | |
let task_list += [task_dict] | |
endfor | |
call setqflist(task_list, 'r') |
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
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 'formula' | |
class Vim < Formula | |
homepage 'http://www.vim.org/' | |
url 'ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2' | |
head 'https://vim.googlecode.com/hg/' | |
sha256 '5c5d5d6e07f1bbc49b6fe3906ff8a7e39b049928b68195b38e3e3d347100221d' | |
version '7.3.682' | |
def features; %w(tiny small normal big huge) 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
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('.')) |