(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
class ApplicationController < ActionController::Base | |
rescue_from ActiveRecord::RecordNotFound, with: :render_not_found | |
def render_not_found | |
respond_to do |format| | |
format.html { render action: "errors/not_found.html.erb", status: 404 } | |
end | |
end | |
end |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
ag -l SEARCH | xargs perl -pi -e "s/SEARCH/REPLACE/g" |
#!/bin/sh | |
if [ $EUID -ne 0 ]; then | |
echo "It's a weird tree." | |
else | |
cat << "EOF" | |
@@@ @@@ | |
@///@ /@@ @; @ | |
@/ //@ / ;@ @;; @ | |
@// ///@ @ ;;@ @;;;;;@ |
-- --with-cppflags=-I/usr/local/opt/openssl/include |
git branch --merged | grep -v "\*" | grep -v master | grep -v staging | xargs -n 1 git branch -d |
convert img20160112_13174979.pdf img20160112_13175002.pdf -quality 100 essay.pdf # +append will split and merge on the same page |
docker rm $(docker ps -aq) |
module Rollout | |
def self.features | |
@features ||= YAML.load_file(Rails.root.join("config", "rollout.yml"))[Rails.env] | |
end | |
def self.features=(value) | |
@features = value | |
end | |
def self.active?(key) |
def retryable(options = {}) | |
opts = { :tries => 1, :on => Exception }.merge(options) | |
retry_exception, retries = opts[:on], opts[:tries] | |
begin | |
return yield | |
rescue retry_exception | |
if (retries -= 1) > 0 | |
sleep 2 |