Retry a command until it fails.
Debugging brittle specs is annoying and time consuming work. Let's automate finding those brittle specs by retrying them until they fail.
Accompanying blog post.
Retry a command until it fails.
Debugging brittle specs is annoying and time consuming work. Let's automate finding those brittle specs by retrying them until they fail.
Accompanying blog post.
#!/bin/bash | |
# "master" is the name of your main branch you'll be comparing to, or you can pass the "parent" branch as an argument | |
# it compares against the current branch by default, but you can pass a second argument to specify a child branch | |
# this creates a permanent alias so you can use `git oldest-ancestor` to get the oldest ancestor of the current branch at any time | |
git config --global alias.oldest-ancestor '!zsh -c '\''diff --old-line-format='' --new-line-format='' <(git rev-list --first-parent "${1:-master}") <(git rev-list --first-parent "${2:-HEAD}") | head -1'\'' -' |
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env | |
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced | |
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start | |
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running. | |
# Add the following to your shell init to set up gpg-agent automatically for every shell | |
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then | |
source ~/.gnupg/.gpg-agent-info | |
export GPG_AGENT_INFO | |
else |
#!/bin/sh | |
# Shell colors for vim-hybrid - Shell color setup script | |
# Luan Santos (http://luansantos.com) | |
if [ "${TERM%%-*}" = 'linux' ]; then | |
# This script doesn't support linux console (use 'vconsole' template instead) | |
return 2>/dev/null || exit 0 | |
fi | |
color017="00/00/5f" |
#![feature(mpsc_select, box_syntax)] | |
use std::io; | |
use std::process::Command; | |
use std::sync::mpsc::{channel, Receiver, Select}; | |
use std::string::FromUtf8Error; | |
use std::thread::spawn; | |
#[derive(Debug)] | |
enum PipeError { |
# Speed things up by not loading Rails env | |
config.assets.initialize_on_precompile = false |
# Create a 10 megabytes, blank, AES 256 Encrypted, with password "mypassword", | |
# MacOS Journaled (Extended) image named "MyImage" when attached, | |
# and myimage.dmg as filename in the current directory. | |
# | |
echo -n "mypassword" | hdiutil create \ | |
-encryption AES-256 \ | |
-stdinpass \ | |
-size 10m \ | |
-fs "Journaled HFS+" \ | |
-volname MyImage \ |
# Change YOUR_TOKEN to your prerender token | |
# Change example.com (server_name) to your website url | |
# Change /path/to/your/root to the correct value | |
server { | |
listen 80; | |
server_name example.com; | |
root /path/to/your/root; | |
index index.html; |
group :production do | |
gem 'unicorn' | |
# Enable gzip compression on heroku, but don't compress images. | |
gem 'heroku-deflater' | |
# Heroku injects it if it's not in there already | |
gem 'rails_12factor' | |
end |