Skip to content

Instantly share code, notes, and snippets.

Avatar

Jesse Buchanan jbinto

View GitHub Profile
@jbinto
jbinto / index.html
Created Nov 2, 2014
[add your bin description] // source http://jsbin.com/begojepigu
View index.html
<!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 Aug 29, 2015
Upgrading Ruby
View upgrading-ruby.md

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.

View dokku-notes.md

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

View solarized.md

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.

View gist:a3f37b1cc3744657101c
[ ] 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 Aug 29, 2015
ansible, dopy, homebrew, python, pip, PYTHON_PATH madness
View fix_pythonpath.sh
# 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
View index.html
<!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 Mar 12, 2013
Demonstrates the concept of class variables vs. instance variables in Ruby.
View gist:5142953
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 Mar 27, 2013
Setting factory_girl as the fixtures replacement. Add to your Rails config/application.rb file.
View gist:5254785
# 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 Dec 15, 2015
A practical example of closures in JavaScript: creating custom loggers.
View gist:5301893
function getLogger(prefix) {
return function(message) {
console.log(prefix + ": " + message);
}
}
// Video component
(function() {
log = getLogger("video");
log("initialized");