Skip to content

Instantly share code, notes, and snippets.

View pepe's full-sized avatar

Josef Pospíšil pepe

View GitHub Profile
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@botanicus
botanicus / gh_open.zsh
Created November 16, 2010 14:45
ZSH: gh_open for opening current repo's page in browser.
# Open GitHub page for the current repository.
#
# Example:
# $ git clone https://github.com/majek/puka.git
# $ cd puka
# $ gh_open # Browser: https://github.com/majek/puka
function gh_open {
open $(git config remote.origin.url | ruby -ne 'puts "https://" + $_.split(%r{[/:@]})[1..-1].join("/").sub(/\.git$/, "")')
}
@uasi
uasi / vim.rb
Created November 30, 2010 16:46
Vim formula for Homebrew (EDIT: recent versions of official Homebrew distribution includes one)
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
@mojombo
mojombo / vwilight.vim
Created January 26, 2011 03:23
vwilight.vim: A TRUE Twilight color theme for Vim
" Vim color file
" Converted from Textmate theme Twilight using Coloration v0.2.5 (http://github.com/sickill/coloration)
set background=dark
highlight clear
if exists("syntax_on")
syntax reset
endif
@JoshMcKin
JoshMcKin / gist:801101
Created January 28, 2011 22:09
Nginx conf for thin clusters with shared ssl and redirect to ssl
user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
@pepe
pepe / my-gh-issues.rb
Created May 9, 2011 07:11 — forked from copiousfreetime/my-gh-issues.rb
My Github Issues
#!/usr/bin/env ruby
#
# A quick script to dump an overview of all the open issues in all my github projects
#
require 'octokit'
require 'awesome_print'
require 'rainbow'
@ariera
ariera / README.markdown
Created August 11, 2011 09:41
A keyboard shortcut to run tests with watchr

A keyboard shortcut to run tests with watchr

When developing in rails I use watchr to run the tests each time a file is saved, but lots of times I find my self adding a whitespace or a newline and saving just to trigger watchr and run the tests.

I wanted to have is a simple keyboard shortcut (like F15) to tell watchr to run the last spec, and mpartel (thx! : ) gave me an idea on how to do it, so here it is:

Dependencies

Obviously you need watchr, but we're also going to need pgrep that will help us find out the pid of the watchr process. So go ahead and do

sudo port install proctools

@argent-smith
argent-smith / how-to.markdown
Created August 17, 2011 10:21
ruby 1.9.2 installation WITH ICONV under rvm and FreeBSD

Ruby 1.9.2 RVM w/iconv FreeBSD installation HOWTO

The Problem

Recently, trying to run some of my crutches (the Ruby thingies I use to help me sysadmining) under RVM, I've found that require 'iconv' doesn't work. Since I knew it's working in standard lang/ruby18 and lang/ruby19 ports I started to search where is the trap and have found that. Here's how.

Prerequisites

  • rvm installed
  • system ruby installed
@martincik
martincik / gist:1183042
Created August 31, 2011 07:59
MBank.cz - Transactions harvester
require 'nokogiri'
require 'open-uri'
require 'mechanize'
require 'logger'
class MBankHarvester
URL = "https://cz.mbank.eu/"
def initialize(login, password, logfile = nil)
@xjones
xjones / TransitionController.h
Created November 26, 2011 03:48
TransitionController for animating iOS view controller transitions w/o a controller stack
//
// TransitionController.h
//
// Created by XJones on 11/25/11.
//
#import <UIKit/UIKit.h>
@interface TransitionController : UIViewController