I hereby claim:
- I am cmbankester on github.
- I am cmbankester (https://keybase.io/cmbankester) on keybase.
- I have a public key ASCyTmwo_SDYj2aJwZ4mrlYFnknPoxzR4gkAndEh77DMqQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
unless File.exist?('Gemfile') | |
File.write('Gemfile', <<-GEMFILE) | |
source 'https://rubygems.org' | |
gem 'rack', github: 'rack/rack' | |
gem 'rails', github: 'rails/rails' | |
gem 'sqlite3' | |
GEMFILE | |
system 'bundle' | |
end |
class Foo < ActiveRecord::Base
belongs_to :bar, inverse_of: :foos
validates :some_attribute,
unmarked_for_destruction_uniqueness: {
parent: :bar
, children: :foos
# , message: "Some message"
}
end
⋊> ~ func-description func-description
Gets the description of a function
⋊> ~
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>homebrew.mxcl.nginx</string> | |
<key>RunAtLoad</key> | |
<true/> | |
<key>KeepAlive</key> | |
<true/> |
class Desk < Formula | |
desc "Lightweight workspace manager for the shell" | |
homepage "https://github.com/jamesob/desk" | |
url "https://github.com/jamesob/desk/archive/v0.3.1.tar.gz" | |
sha256 "b687e2cfa742f763d689391f67a5b5225324e282a0fed100487b1570988d7758" | |
def install | |
bin.install "desk" | |
end |
#!/bin/bash | |
# Usage: | |
# file-event-watch command-to-run path1 [path2, ...] | |
# TODO: Add fswatch event option to enable/disable different event types | |
cmd=$1 | |
shift | |
files=$@ | |
$cmd && fswatch -0 -x -r $files | { |
#!/bin/sh | |
# add `export COREOS_DOCKER_HOST_IP=some-ip-address` to your .bashrc or .zshrc | |
function echo_usage_and_exit() | |
{ | |
echo "Usage: coreos-sync local_path_to_sync remote_dir_to_sync_into [options]" | |
echo "Options:" | |
echo "\t-w\t\t(watches/resyncs on changes)" | |
echo "\t-v\t\t(enable verbose mode)" |
function scanRemove(cursor, prefix, count) { | |
return redis | |
.scan(cursor, 'MATCH', `${prefix}*`, 'COUNT', count) | |
.then(([cur, keys]) => redis.del(keys).then(() => Promise.resolve(cur))) | |
.then(cur => (cur !== 0 && cur !== '0') ? scanRemove(cur, prefix, count) : Promise.resolve()); | |
} | |
function removeAllMatching(prefix, count=10) { | |
return scanRemove(0, prefix, count) | |
.catch(err => {throw new Error(`Scan-remove failed: ${err.message}`);}); |