Skip to content

Instantly share code, notes, and snippets.

@joeybaker
joeybaker / nosudonpm.sh
Created May 28, 2014
Don't need sudo for npm install
View nosudonpm.sh
# no sudo for global installs!
sudo chown -R `whoami` ~/.npm; sudo chown -R `whoami` /usr/local/lib/node_modules
@joeybaker
joeybaker / sslterminators.md
Last active Aug 29, 2015
ssl terminator research
View sslterminators.md
@joeybaker
joeybaker / onFeatureBranches.md
Last active Aug 29, 2015
github flow modified
View onFeatureBranches.md

I'm a big fan of github flow. Which basically states that you should create a branch for each feature, then merge it into master only when it's ready to push to production. However, github flow is a bit ambiguous about how to resolve conflicts between your feature branch and master. What follows is a method of dealing with that problem.

  • Anything in the master branch is deployable
  • To work on something new, create a descriptively named branch off of master (ie: new-oauth2-scopes)
  • Commit to that branch locally and regularly push your work to the same named branch on the server
  • When you need feedback or help, or you think the branch is ready for merging, open a pull request
  • After someone else has reviewed and signed off on the feature, you can merge it into master
  • a really good addition: how to merge into master. Here's why
@joeybaker
joeybaker / newubuntuserver.md
Created Jul 16, 2014
setup a new ubuntu server
View newubuntuserver.md

new ubuntu server

# add a non-root user
sudo adduser <username> sudo
su <username>
# paste in your ssh key
# ssh-copy-id -i <username>@<host> 
sudo vi /etc/ssh/sshd_config
# set PasswordAuthentication no
@joeybaker
joeybaker / couchconfig.md
Created Jul 16, 2014
configuring couchdb
View couchconfig.md

couchdb setup

  • create an admin user
  • then
couch_httpd_auth
    require_valid_user = true
couchdb
    delayed_commits = false
couch_httpd_auth
@joeybaker
joeybaker / bud.xml
Last active Aug 29, 2015
svc config for bud-tls on SmartOS
View bud.xml
<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<!--
Created by Manifold
--><service_bundle type="manifest" name="bud">
<service name="bud" type="service" version="1">
<create_default_instance enabled="true"/>
View biggest pain points.md
  • npm all the things! It sucks when packages aren't browserify-able.
  • functional/integration tests are incredibly painful to write, run, and maintain.
  • even client side unit tests are hard to debug.
  • I know dev tools are working hard on being an editor, but I wish there was better integration between dev tools and my editor. Editors are hard, dev tools should let the apps that do it well, manage the problem.
  • I wish there was a way to "live reload" js in a hot-swap kinda way.
  • JS errors tend to suck. Async stack traces are a huge win, but some errors are always inscrutable: undefined is not a function
@joeybaker
joeybaker / usesBash.sh
Created Sep 24, 2014
see if any processes are running bash using dtrace
View usesBash.sh
dtrace -n 'proc:::exec-success/basename(execname)=="bash"/{printf("%d executed %s\n", ppid, execname);}'
View result.html
<body><main><h1>hi</h1><img width="500" src="http://cat.jpg.to"><input><p>graf</p></input></img></main></body>
View A weekend with react.md

A Weekend With React

I spent Saturday doing another dive into React 0.12 and ES6. I just wanted to share some of the experience since it's a stack that we're strongly considering adopting (for at least some) of our future work.

Once you get past the weirdness of writing HTML in your JS, it's actually really nice to control your template so directly. Part of it maybe that I'm learning ES6 syntax at the same time, but I'm no longer weirded out by JSX. I'm using the 6to5ify browserify transform, so nearly the full spectrum of ES6 is available, and it feels great. Highlights are destructing and the class syntax (I was surprised!). This is legit code:

  // named fuction for free! Don't even need to use the function keyword!
  , getInitialState(){
    var deadline = moment([2015, 8, 6])
You can’t perform that action at this time.