As configured in my dotfiles.
start new:
tmux
start new with session name:
# Usage: | |
# | |
# @model.doSomething = -> | |
# @other_model.trigger('something_done', 'somearg') | |
# | |
# expect(=> @model.doSomething()).toTrigger('something_done', on: @other_model, with: [ 'somearg' ]) | |
# | |
beforeEach -> |
As configured in my dotfiles.
start new:
tmux
start new with session name:
I've been using this technique in most of my Ruby projects lately where Ruby versions are required:
.rbenv-version
containing the target Ruby using a definition name defined in ruby-build (example below). These strings are a proper subset of RVM Ruby string names so far....rvmrc
(with rvm --create --rvmrc "1.9.3@myapp"
) and edit the environment_id=
line to fetch the Ruby version from .rbenv-version
(example below).Today I learned about another Ruby manager, rbfu, where the author is using a similar technique with .rbfu-version
.
class Searcher | |
def search(query) | |
with_retries do | |
Item.search(query, populate: true) | |
end | |
end | |
private |
Copy, with line wrapping!
If you've been trying to copy/paste text from a multi-pane tmux
session with the mouse, you've probably been pretty pissed at the blissful ignorance a terminal application has of the rodent in your hand.
The alternative, which is quote-unqoute native copy/pasting using copy-mode takes a bit to get used to. So this is one solution for copying and pasting lines from a session with correct line wrapping behaviour, albeit keyboard only.
Disclaimer
Since copy-mode has similar concepts of marks, regions, and temp buffers to Emacs .. you'll probably find it straight forward if you're familar with Emacsen. For people using vi-mode in tmux
, the same still applies but obviously the default key bindings will differ alot from what I show below.
This installs a patched ruby 1.9.3-p327 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.
You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf
using homebrew.
Posted on September 23 2011 by Richard Taylor (@moomerman)
In a two-part post I'm going to show you some tricks you can do with SSH logins. This post covers setting up two-factor SSH authentication with the Google Authenticator app.
I was recently getting some servers in shape so I can pass the Payment Card Industry standards questionnaire and one requirement was two-factor authentication access to the server. I queried whether SSH key + passphrase was acceptable but didn't get a clear answer so I figured I'd explore setting up another authentication factor myself, plus it piqued my interest.
After a bit of research I found it was possible using a PAM module but it doesn't work along with SSH key authentication (only password authentication) and I only use SSH key logins for my servers.
This gist is no longer valid. Please see Compass-Rails for instructions on how to install.
#!/bin/sh | |
# Just copy and paste the lines below (all at once, it won't work line by line!) | |
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY! | |
function abort { | |
echo "$1" | |
exit 1 | |
} | |
set -e |
Spork.prefork do | |
require "rails/application" | |
# Prevent Devise from loading the User model super early with it's route hacks for Rails 3.1 rc4 | |
# see also: https://github.com/timcharper/spork/wiki/Spork.trap_method-Jujutsu | |
Spork.trap_method(Rails::Application, :reload_routes!) | |
Spork.trap_method(Rails::Application::RoutesReloader, :reload!) | |
# rest of your prefork here... | |
end |