Skip to content
View factories.rb
module Factories
def new_user(attrs = {})
attrs[:email] ||= "foo@example.com"
attrs[:password] ||= "foo123456"
attrs[:password_confirmation] ||= attrs[:password]
User.new(attrs)
end
def create_user(attrs = {})
new_user(attrs).save!
View test.md

test

test

test

test

test
View gist:7cb5b50b6b2010456d87
gs -dNOPAUSE -sDEVICE=png16m -r300 -sOutputFile=p%03d.png file.pdf
View anki.rb
#!/usr/bin/env ruby
# Usage:
#
# => brew install imagemagick
# => gem install anki2 kramdown rmagick image_optim image_optim_pack
# => chmod +x ./anki.rb
# => ./anki.rb questions.md
require 'rubygems'
View cdmon.sh
#!/bin/bash
USER=<username>
PASS=<password-md5>
HOST=<host>
DOMAIN_IP=$(host $HOST dinamic1.cdmon.net | grep -m1 $HOST | awk {'print $4'})
EXTERNAL_IP=$(curl -s icanhazip.com)
RESULT="$EXTERNAL_IP - Nothing to update"
View architecture-on-the-screen.txt
A
AALTO, HUGO ALVAR HENRIK (1898-1976)
— Alvar Aalto: A Finnish Architect (1972) http://www.imdb.com/title/tt1703015/
— Alvar Aalto: Technology and Nature (1987) http://www.imdb.com/title/tt2049387/
— 10 Finnish Architects: An Outsider’s View (2003) http://www.imdb.com/title/tt0830160/
ACCONCI, VITO HANNIBAL (1940)
— Interiors, Buildings And Parks (2004) http://www.worldcat.org/…/314516598
ALEIJADINHO (LISBOA, ANTONIO FRANCISCO) (1730/1738-1814)
— O Aleijadinho (1978) M
View gifcast.zsh
gifcast () {
mkdir /tmp/gifcast
ffmpeg -i "$@" -r 10 /tmp/gifcast/gifcast%05d.png
convert -layers Optimize /tmp/gifcast/gifcast*.png gifcast.gif
rm /tmp/gifcast/gifcast*.png
rmdir /tmp/gifcast
}
Something went wrong with that request. Please try again.