This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set a view's attribute equal to the return value of | |
# a (usually expensive) callback. If the prime argument | |
# is true, it will call it again, priming the cache | |
# with the latest data. | |
Backbone.View::cache = (name, callback, prime = false) -> | |
if !@[name]? or prime is true | |
@[name] = callback() | |
else | |
@[name] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew install multitail | |
multitail -l "ssh staging 'railslog'" -l "ssh production 'railslog'" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export EDITOR="atom -n" | |
export GIT_EDITOR="atom -w" | |
edit() atom -n $* | |
alias nano="atom" # until muscle memory goes away... | |
alias ttv="cd ~/Repositories/totaltv" | |
alias fs="be foreman start" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
JS source: https://github.com/umdjs/umd/blob/master/returnExportsGlobal.js | |
Uses Node, AMD or browser globals to create a module. This example creates | |
a global even when AMD is used. This is useful if you have some scripts | |
that are loaded by an AMD loader, but they still want access to globals. | |
If you do not need to export a global for the AMD case, see returnExports.coffee. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew uninstall rbenv | |
brew uninstall ruby-build | |
rm -rf $HOME/.rbenv | |
exec $SHELL -l | |
cd $HOME | |
\curl -sSL https://get.rvm.io | bash -s stable --ruby=2.1.2 | |
source $HOME/.rvm/scripts/rvm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM uggedal/alpine-3.0 | |
# - update the source repositories | |
# - add the 'build-base' metapackage, which includes: binutils, gcc, make, patch, libc-dev, g++ | |
# - do your stuff to wget, gunzip, tar xf, configure, make, make install, etc. | |
# - uninstall/purge the build-base package & dependencies | |
RUN apk update && apk add build-base && \ | |
# ... && \ | |
apk del build-base --purge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# # vi: set ft=ruby : | |
require 'fileutils' | |
Vagrant.require_version ">= 1.6.0" | |
CLOUD_CONFIG_PATH = File.join(File.dirname(__FILE__), "cloud-config.yml") | |
require File.join(File.dirname(__FILE__), "config.rb") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Bijective | |
ALPHA = "UDip8sOCeQFMtZ1SmwbuKgH4N3P0r2B9o765LnWcqdxJRjkfyhIzlVvXAGTEaY".split(//) | |
BASE = 62 | |
def self.encode(i) | |
return ALPHA[0] if i == 0 | |
"".tap do |s| | |
s << ALPHA[i.modulo(BASE)] and i /= BASE while i > 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
chown -R splunk:splunk /var/splunk | |
exec /sbin/setuser splunk /opt/splunk/bin/splunk start splunkd --nodaemon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Example: | |
# | |
# \curl -fsSL http://srv.im/change-hostname.sh | sudo bash /dev/stdin hostname.example.com | |
_hostname="$1" | |
_dnsline="127.0.1.1\t$1" | |
hostnamectl set-hostname ${_hostname} |