Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am craigbeck on github.
  • I am keymaster (https://keybase.io/keymaster) on keybase.
  • I have a public key whose fingerprint is 9690 9DA8 AE6E 9444 959E D148 D9E6 0298 0B77 2938

To claim this, I am signing this object:

@craigbeck
craigbeck / 0_reuse_code.js
Created July 15, 2014 06:02
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@craigbeck
craigbeck / install.sh
Last active August 29, 2015 14:09
install docker on Fedora/RHEL
sudo yum -y install docker-io && \
sudo service docker start && \
sudo chkconfig docker on
# add vagrant user to docker group so sudo not required
sudo usermod -aG docker vagrant
# must logout and login again for gorup to be applied
# verify docker
# sudo docker run -i -t fedora /bin/bash
@craigbeck
craigbeck / Vagrantfile.rb
Created November 14, 2014 21:31
Fedora/Rails/Docker Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
RAILS_PORT = 3000
RVM_RUBY_VERSION = "1.9.3-p448"
@craigbeck
craigbeck / sigtest.sh
Created November 15, 2014 06:28
signals in bash
#!/bin/sh -e
function do_exit() {
echo
echo "exiting..."
exit 0
}
trap do_exit INT
@craigbeck
craigbeck / ingredient.pegjs
Created January 2, 2015 07:51
PEG.js syntax for parising ingredient line of recipe
start
= lines
lines
= line+
line
= val:ingredientLine "/n"? { return val }
@craigbeck
craigbeck / README.md
Created February 16, 2015 22:19
Fix Mailbox.app crashing on startup

Problem

Mailbox.app crashes on startup every time. This happend after a Gmail account was disabled (account associated with previous job) before it was removed from Mailbox.app. This caused crashes on the iOS and OS X versions of the app that made them both unusable.

iOS

An updated app was relased at some point that allowed me to "delete" the prevoiusly deactivated account and has been working for a number of weeks.

OS X

@craigbeck
craigbeck / git-workflow.md
Created April 1, 2015 16:45
git workflow OS X

First, you have to get your repository. Use git clone to get the repository into your current directory form the terminal

git clone https://github.com/craigbeck/git-workflow-demo.git

The above will create a directory git-workflow-demo in the current directory that contains the "repo" (assuming a real repository, the above URL is just a made-up example). Change to this new directory with cd git-workflow-demo. Your newly cloned repo should look something like this:

$ ls -la
@craigbeck
craigbeck / .bash_profile
Last active August 29, 2015 14:19
Quick profile setup
# aliases
alias cls='clear'
alias ls='ls -FG'
alias ll='ls -l'
alias la='ll -a'
# git completion
if [ -f `brew --prefix`/etc/bash_completion.d/git-completion.bash ]; then
. `brew --prefix`/etc/bash_completion.d/git-completion.bash
fi
@craigbeck
craigbeck / viewport-info.jsx
Created May 14, 2015 23:15
React ViewportInfo component
var ViewportInfo = React.createClass({
getInitialState: function () {
return {
width: null,
height: null
};
},