Skip to content

Instantly share code, notes, and snippets.

=Clicking links and buttons=
click_link('Link Text')
click('Link Text') # Click either a link or a button
click('Button Value')
exAspArk / simple_form.rb
Last active December 26, 2015 12:28 — forked from clyfe/simple_form.rb
# Use this setup block to configure all options available in SimpleForm.
SimpleForm.setup do |config|
config.boolean_style = :nested
config.wrappers :bootstrap3, tag: 'div', class: 'form-group', error_class: 'has-error',
defaults: { input_html: { class: 'default_class' } } do |b|

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command


  • super+t: go to file
  • super+ctrl+p: go to project
  • super+r: go to methods
# First install tmux
brew install tmux
# For mouse support (for switching panes and windows)
# Only needed if you are using (iTerm has mouse support)
Then install
# More on mouse support

Setting Up Clojure on OS X

I spent a lot of time trying to find a pretty optimal (for me) setup for Clojure… at the same time I was trying to dive in and learn it. This is never optimal; you shouldn't be fighting the environment while trying to learn something.

I feel like I went through a lot of pain searching Google, StackOverflow, blogs, and other sites for random tidbits of information and instructions.

This is a comprehensive "what I learned and what I ended up doing" that will hopefully be of use to others and act as a journal for myself if I ever have to do it again. I want to be very step-by-step and explain what's happening (and why) at each step.

Step 1: Getting Clojure (1.3)


This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

convert $1 -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 $2


Docker Cheat Sheet


Why Should I Care (For Developers)

"Docker interests me because it allows simple environment isolation and repeatability. I can create a run-time environment once, package it up, then run it again on any other machine. Furthermore, everything that runs in that environment is isolated from the underlying host (much like a virtual machine). And best of all, everything is fast and simple."

TL;DR, I just want a dev environment

RSpec.configure do |config|
config.before(:suite) do
config.before(:each) do
DatabaseCleaner.strategy = :transaction
config.before(:each, js: true) do
exAspArk / gist:4aa5fa70acf5d492eda7
Last active August 29, 2015 14:02
Nested symbolize keys (ruby)
def nested_symbolize_keys(thing)
case thing
when Array { |value| nested_symbolize_keys(value) }
when Hash
Hash[ { |key, value| [key.to_sym, nested_symbolize_keys(value)] }]