This is now an actual repo:
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('.')) |
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
#!/usr/bin/env ruby -KU | |
require 'optparse' | |
require 'ostruct' | |
require 'iconv' | |
SCRIPT_NAME = "File Character Encoding Converter" | |
SCRIPT_VERSION = "0.1" | |
class FileEncodingConverterOptionParser |
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
# This is an example of how you can set up screenshots for your | |
# browser testing. Just run cucumber with --format html --out report.html | |
# | |
module Screenshots | |
def embed_screenshot(id) | |
%x(scrot #{$ROOT_PATH}/images/#{id}.png) | |
end | |
end | |
World(Screenshots) |
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
#!/bin/bash | |
git --no-pager grep "$@" | |
git --no-pager submodule --quiet foreach 'git grep --full-name -n ' "$@" '; true' |
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 | |
Capistrano::Configuration.instance(:must_exist).load do | |
namespace :rails do | |
desc "Open the rails console on one of the remote servers" | |
task :console, :roles => :app do | |
hostname = find_servers_for_task(current_task).first | |
exec "ssh -l #{user} #{hostname} -t 'source ~/.profile && #{current_path}/script/rails c #{rails_env}'" | |
end | |
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
<html> | |
<head> | |
<title>Simple Sparkline using SVG Path and d3.js</title> | |
<script src="http://mbostock.github.com/d3/d3.v2.js"></script> | |
<style> | |
/* tell the SVG path to be a thin blue line without any area fill */ | |
path { | |
stroke: steelblue; | |
stroke-width: 1; | |
fill: none; |
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
// Assumes you are using <html> conditional classes as described here: | |
// http://paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ | |
.lt-ie7 { | |
// blockquote small:before{content:'\2014 \00A0';} | |
blockquote small:before{content:"";} | |
// [class*="span"]{display:inline;float:left;margin-left:20px;} | |
.span1{display:inline;float:left;margin-left:20px;} | |
.span2{display:inline;float:left;margin-left:20px;} | |
.span3{display:inline;float:left;margin-left:20px;} | |
.span4{display:inline;float:left;margin-left:20px;} |
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
module TableMatchHelper | |
# @param table [Array[Array]] | |
# @param expected_table [Array[Array[String]]] | |
# The expected_table values are String. They are converted to | |
# Regexp when they start and end with a '/' | |
# Example: | |
# | |
# assert_table_match( | |
# [["Name", "Date"], ["Philippe", "Feb 08"]], | |
# [["Name", "Date"], ["Philippe", "/\w{3} \d{2}/"]] |
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
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
OlderNewer