Skip to content
View sinatra+thin+ssl.rb
#!/usr/bin/env ruby
# This code snippet shows how to enable SSL in Sinatra+Thin.
require 'sinatra'
require 'thin'
class MyThinBackend < ::Thin::Backends::TcpServer
def initialize(host, port, options)
openssl genrsa -des3 -passout pass:x -out server.pass.key 2048
openssl rsa -passin pass:x -in server.pass.key -out server.key
rm server.pass.key
openssl req -new -key server.key -out server.csr
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
View gist:e30bef22f260604220e9
sudo kextunload -b
sudo kextload -b
# because we don't have findsn with fslint, we need to do it ourselves
# find . -type f -exec basename {} \; | \ # get the name of the file. could be substituted to do hashes here
# sort | \ # prep for counting
# uniq -c | \ # count occurences
# grep -v "^[ \t]*1 " | \ # mind the formatting
# awk '{print $2}' | \ # get only the file names, not the counts
# xargs -I {} find . -name '{}*' # find the location of the duplicates
find . -type f -exec basename {} \; | \
View index.html
<html ng-app="myApp">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Basic App</title>
<link rel="stylesheet" href="">
<link rel="stylesheet" href="">
# set these in your .bash_profile, .bashrc, .zshrc first
HISTFILESIZE=100000 # how many lines to keep total
HISTSIZE=100000 # how many lines to keep for the current session
# oh-my-zsh will default to a reasonable 10000, but most bash defaults to a few hundred
# oh-my-zsh by default appends all commands to history after they are run instead of on session end
# search the history with control-r
# search for commands starting with the one you typed with alt-p
# if you don't want something to stay in your history, prefix the command with a space
View gist:c42f95ee98e909fccfe4
Verifying that +nahurst is my openname (Bitcoin username).
View gist:d2f6f9b18bc8638a3e25
service = angular.element(document).injector().get('cubeService')
service.track('plb_test', {'hi' : 'nathan'})
git reset --soft HEAD^ # when you just committed something you didn't mean to and you want to change the contents and the message
git commit --amend # when you want to change the commit message you just made
git reset file # when you have a file staged for delete that you want to unstage
git checkout file # when you want to restore that file you unstaged file to it's original version
git reset HEAD file # when you want to unstage a staged change
git reset --soft "HEAD^" # when you just committed something, but you want to undo the commit and revert everything to how it was staged before the commit
# minimize the use of these for better copy
# am,is,are,was,were,be,being,been,become,became,has,have,had,do,does,did,may,might,must,can,could,shall,should,will,would
Something went wrong with that request. Please try again.