Skip to content

Instantly share code, notes, and snippets.

View kennym's full-sized avatar

Kenny Meyer kennym

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')
@jmazzi
jmazzi / lastpass_to_keepassx.rb
Created June 13, 2010 19:57
Convert LastPass CSV to KeePassX XML
#!/usr/bin/ruby
#
# I recommend using Pocket to do the export. It works better than the browser extensions.
require 'rubygems'
require 'htmlentities'
require 'csv'
# CHANGE THIS
input_file = '/path/to/passwords.csv'
require 'rubygems'
require 'nokogiri'
class MyFilter
def ends_with set, ends
set.map { |x| x.to_s }.join.end_with? ends
end
end
doc = Nokogiri.XML(DATA)
@nu7hatch
nu7hatch / app.rb
Created April 21, 2011 03:05
OmniAuth login in popup
require 'rubygems'
require 'sinatra'
require 'omniauth/oauth'
set :sessions, true
set :layout, true
use OmniAuth::Builder do
provider :twitter, 'key', 'secret'
end
@wheresalice
wheresalice / fib.io
Created May 3, 2011 12:01
Fibonacci series in Io language
#!/usr/bin/env io
fib := method(
a := 0
b := 1
for(i, 1, doMessage(call message argAt(0)) - 1, c := a + b; a := b; b := c)
)
fib(10) println
@jondkinney
jondkinney / README.md
Created May 6, 2011 07:54 — forked from napcs/README.md
Deploying Rails to Linode

Deploying Rails to Linode

Installing Ruby Enterprise Edition, Apache, MySQL, and Passenger for deploying Rails 3.0 applications.

Get a Linode, and set it up with Ubuntu 10.04 LTS so that you have till April 2013 to get updates. Once the Linode is formatted, boot it and continue on.

Set up an 'A' record in your DNS, pointing to the IP of your Linode. I'm using demo.napcs.com here.

Initial setup

@kennym
kennym / blogspot_to_jekyll.rb
Created July 30, 2011 18:14
Migrate your blogger blog posts to jekyll.
#!/usr/bin/env ruby
#
# Convert blogger (blogspot) posts to jekyll posts
#
# Basic Usage
# -----------
#
# ./blogger_to_jekyll.rb feed_url
#
# where `feed_url` can have the following format:
@willywg
willywg / devise.es.yml
Created August 9, 2011 12:38
devise I18n file in spanish for devise 1.4.2
# Additional translations at http://github.com/plataformatec/devise/wiki/I18n
# Translation by William Wong Garay (willywg) https://github.com/willywg
es:
errors:
messages:
expired: "ha expirado, por favor solicita una nueva"
not_found: "no se encontró"
already_confirmed: "ya fue confirmado, por favor intenta iniciar sesión"
not_locked: "no estaba bloqueado"
@bxt
bxt / csv-export.sh
Created September 13, 2011 20:58
Exporting whole MySQL databse to CSV files
#!/bin/bash
# USAGE: Will create a .tar.gz with CSVs of all tables in schema.
# Configure below and run as root (i.e. the user mysql runs as)
#
# The script will (or should) SELECT * INTO OUTFILE your tables
# and save them into csv files under /tmp dir first, then name them
# like the tables and move them thogether into a directory. Then
# it will tar everything together and chown you the tarball.
# Schema to export:
@p01
p01 / LICENSE.txt
Last active May 23, 2024 13:46 — forked from 140bytes/LICENSE.txt
Sudoku Solver in 140bytes
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Mathieu 'p01' Henri - http://www.p01.org/releases/
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE