start new:
tmux
start new with session name:
tmux new -s myname
# Supresses automatic updates of SASS so as not to offend your Heroku slug | |
Sass::Plugin.options[:never_update] = true |
=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') |
#making .irbrc posted at http://www.tech-angels.fr/post/963080350/improve-irb-and-fix-it-on-mac-os-x | |
#work with rails3 | |
require 'rubygems' | |
#rails3: be sure to include wirble and hirb in your Gemfile | |
require 'wirble' | |
require 'hirb' | |
Wirble.init | |
Wirble.colorize | |
# hirb (active record output format in table) |
So you've cloned somebody's repo from github, but now you want to fork it and contribute back. Never fear! | |
Technically, when you fork "origin" should be your fork and "upstream" should be the project you forked; however, if you're willing to break this convention then it's easy. | |
* Off the top of my head * | |
1. Fork their repo on Github | |
2. In your local, add a new remote to your fork; then fetch it, and push your changes up to it | |
git remote add my-fork [email protected] |
# A simple function to return a signed, expiring url for Amazon Cloudfront. | |
# As it's relatively difficult to figure out exactly what is required, I've posted my working code here. | |
# This will require openssl, digest/sha1, base64 and maybe other libraries. | |
# In my rails app, all of these are already loaded so I'm not sure of the exact dependencies. | |
module CloudFront | |
def get_signed_expiring_url(path, expires_in, private_key_filename, key_pair_id) | |
# AWS works on UTC, so make sure you are not using local time |
#!/usr/bin/env ruby | |
hits_ = nil | |
misses_ = nil | |
loop do | |
`redis-cli info | grep keyspace` =~ /hits:(\d+).*misses:(\d+)/m | |
hits, misses = $1.to_i, $2.to_i | |
if hits_ |
# Generating throwaway QR codes from the command line for shunting URLS to mobile devices | |
brew install qrencode | |
qrencode -o - http://www.google.com | open -f -a preview |
People
![]() :bowtie: |
😄 :smile: |
😆 :laughing: |
---|---|---|
😊 :blush: |
😃 :smiley: |
:relaxed: |
😏 :smirk: |
😍 :heart_eyes: |
😘 :kissing_heart: |
😚 :kissing_closed_eyes: |
😳 :flushed: |
😌 :relieved: |
😆 :satisfied: |
😁 :grin: |
😉 :wink: |
😜 :stuck_out_tongue_winking_eye: |
😝 :stuck_out_tongue_closed_eyes: |
😀 :grinning: |
😗 :kissing: |
😙 :kissing_smiling_eyes: |
😛 :stuck_out_tongue: |
# MODEL | |
class Case < ActiveRecord::Base | |
include Eventable | |
has_many :tasks | |
concerning :Assignment do | |
def assign_to(new_owner:, details:) | |
transaction do |