Skip to content

Instantly share code, notes, and snippets.

@elikem
elikem / wordpress plugins
Last active August 29, 2015 13:58
WordPress Plugins
BackWPup
All In One WP Security
=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')
@elikem
elikem / multiple_files.rb
Created April 26, 2014 00:22
load multiple files in a directory and require them
require 'this_and_that_or...'
Dir[File.dirname(__FILE__) + ‘/lib/*.rb’].each { |file| require file }
@elikem
elikem / workers.rake
Created May 11, 2014 11:20 — forked from karmi/workers.rake
Launching and Killing Resque worker processes
# Rake task to launch multiple Resque workers in development/production with simple management included
require 'resque/tasks' # Require Resque tasks
namespace :workers do
# = $ rake workers:start
#
# Launch multiple Resque workers with the Rails environment loaded,
# so they have access to your models, etc.
@elikem
elikem / capybara cheat sheet
Created May 12, 2014 21:05 — forked from zhengjia/capybara cheat sheet
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')
@elikem
elikem / Rails Console with Pry
Created May 14, 2014 21:42
Rails Console with Pry
pry -r ./config/environment
@elikem
elikem / callbacks.js
Last active August 29, 2015 14:01
Callbacks
function someAction(x, y, someCallback) {
return someCallback(x, y);
}
function calcProduct(x, y) {
return x * y;
}
function calcSum(x, y) {
return x + y;
@elikem
elikem / css layout color outline
Created May 28, 2014 22:07
Website Layout and Grid Definition with CSS
* { background-color: rgba(255,0,0,.2); }
* * { background-color: rgba(0,255,0,.2); }
* * * { background-color: rgba(0,0,255,.2); }
* * * * { background-color: rgba(255,0,255,.2); }
* * * * * { background-color: rgba(0,255,255,.2); }
* * * * * * { background-color: rgba(255,255,0,.2); }
@elikem
elikem / maintain aspect ration with css
Created May 28, 2014 22:09
Maintain Aspect Ratio with CSS
<div style="width: 100%; position: relative; padding-bottom: 20%;">
<div style="position: absolute; left: 0; top: 0; right: 0; bottom: 0;">
this content will have a constant aspect ratio that varies based on the width.
</div>
</div>
@elikem
elikem / bitcoin sinatra.rb
Last active August 29, 2015 14:02
Sinatra Demo App -- Bitcoin Prices
require "sinatra"
require 'mechanize'
require 'json'
require 'hashie'
require 'bigdecimal'
require "sqlite3"
require "active_record"