Skip to content

Instantly share code, notes, and snippets.

@budnik
budnik / quiz2.rb
Created February 12, 2014 07:52 — forked from fxposter/quiz2.rb
def check
yield
rescue => e
e
end
check { "hello, #{1}" } # ?
check { "hello, " + 1 } # ?
check { "hello, " << 1 } # ?
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
/*
** Copyright 2006, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
@budnik
budnik / service
Last active December 15, 2015 09:09 — forked from brentkirby/service
#!/bin/bash -e
#
# Since unicorn creates a new pid on restart/reload, it needs a little extra love to
# manage with runit. Instead of managing unicorn directly, we simply trap signal calls
# to the service and redirect them to unicorn directly.
#
# To make this work properly with RVM, you should create a wrapper for the app's gemset unicorn.
#
function is_unicorn_alive {