Skip to content

Instantly share code, notes, and snippets.

View jbinto's full-sized avatar

Jesse Buchanan jbinto

View GitHub Profile
@jbinto
jbinto / index.html
Created November 2, 2014 07:40
[add your bin description] // source http://jsbin.com/begojepigu
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="[add your bin description]" />
<script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
<style id="jsbin-css">
select {
display: block;
@jbinto
jbinto / upgrading-ruby.md
Last active August 29, 2015 14:09
Upgrading Ruby

Upgrading Ruby

"If something is painful, do it more often."

  • 2.1.5: Nov 13 2014

OS X

I am using chruby and ruby-install.

@jbinto
jbinto / dokku-notes.md
Last active August 29, 2015 14:09
dokku

Notes

Installing:

  • DigitalOcean NYC3 Dokku 0.2.3 on 14.04 with Docker 1.2.0) - create droplet with public key, get an IP address
  • Set up DNS for jbinto.ca: A records for jbinto.ca and *.jbinto.ca
  • DNS won't propogate immediately, so edit /etc/hosts for now
  • Go to http://jbinto.ca, check "Use virtual hosts", verify public key and hostname, finish setup

Deploying

iTerm2

http://www.iterm2.com/#/section/downloads

Get the iTerm color settings

https://raw.github.com/altercation/solarized/master/iterm2-colors-solarized/Solarized%20Dark.itermcolors

Apply them in iTerm through iTerm -> preferences -> profiles -> -> colors -> load presets -> import. You can create a different profile, other than Default if you wish to do so.

[ ] router:main ................................................ multiverse/main/router
vendor-5ca4ffb34d25585cca2282f42bb15971.js:7 [ ] router:main ................................................ multiverse/router
vendor-5ca4ffb34d25585cca2282f42bb15971.js:7 [✓] router:main ................................................ multiverse/router
vendor-5ca4ffb34d25585cca2282f42bb15971.js:7 [✓] router:main ................................................ multiverse/router
vendor-5ca4ffb34d25585cca2282f42bb15971.js:7 [✓] router:main ................................................ multiverse/router
vendor-5ca4ffb34d25585cca2282f42bb15971.js:7 [ ] -bucket-cache:main ......................................... multiverse/main/-bucket-cache
vendor-5ca4ffb34d25585cca2282f42bb15971.js:7 [ ] -bucket-cache:main ......................................... undefined
vendor-5ca4ffb34d25585cca2282f42bb15971.js:7 [ ] -bucket-cache:main ......................................... multiverse/-bucket-cache
vendor-5ca4ffb34d25585cca2282
@jbinto
jbinto / fix_pythonpath.sh
Last active August 29, 2015 14:10
ansible, dopy, homebrew, python, pip, PYTHON_PATH madness
# situation:
# * Installed python+pip from homebrew.
# * Installed ansible from homebrew, then un/reinstalled with pip+git (requirements.txt)
# * Ansible cannot see `dopy` module installed via requirements.txt.
# solution:
# see https://github.com/jlund/streisand/issues/12
mkdir -p ~/Library/Python/2.7/lib/python/site-packages
echo '/usr/local/lib/python2.7/site-packages' > ~/Library/Python/2.7/lib/python/site-packages/homebrew.pth
@jbinto
jbinto / index.html
Created November 27, 2015 21:56 — forked from anonymous/index.html
JS Bin // source http://jsbin.com/wuwezo
<!DOCTYPE html>
<html>
<head>
<script src="https://fb.me/react-0.14.3.min.js"></script>
<script src="https://fb.me/react-dom-0.14.3.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/redux/3.0.4/redux.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
@jbinto
jbinto / gist:5142953
Created March 12, 2013 13:44
Demonstrates the concept of class variables vs. instance variables in Ruby.
class Dog
attr_accessor :breed, :color, :description
def Dog.description
# Return @@description, unless it's nil, in that case return a fixed string.
@@description ||= "All dogs are 4 legged animals that bark."
end
def Dog.description=(new_description)
@@description = new_description
@jbinto
jbinto / gist:5254785
Created March 27, 2013 14:51
Setting factory_girl as the fixtures replacement. Add to your Rails config/application.rb file.
# So we can run "rails generate" from the command line to create factories
config.generators do |g|
g.fixture_replacement :factory_girl
end
@jbinto
jbinto / gist:5301893
Last active December 15, 2015 18:09
A practical example of closures in JavaScript: creating custom loggers.
function getLogger(prefix) {
return function(message) {
console.log(prefix + ": " + message);
}
}
// Video component
(function() {
log = getLogger("video");
log("initialized");