Skip to content

Instantly share code, notes, and snippets.

View bhgraham's full-sized avatar

Benjamin H. Graham bhgraham

View GitHub Profile
// ==UserScript==
// @name CosmosisT's TinyChat Script (CTS V1.3.87)
// @version 1.3.87
// @description Modified TinyChat - Best Scripts; prepare to be amazed.
// @author CosmosisT
// @url https://gist.github.com/CosmosisT
// @license Copyright (C) 2019 CosmosisT
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
print the whole rendered article bookmark with this URL to print the preview:
javascript:var w = window.open();var html = "<!doctype html><html><body>" + $(".js-rendered-markdown").html() + "<script>w.print();</script>" + "</body></html>";$(w.document.body).html(html);
login bookmarklet
javascript:(function(){window.location=window.location.origin+'/ghost';})();
edit post
Drag the link below to your bookmarks bar and click it when you’re viewing a post on your Ghost blog:<br /><br /><a href="javascript:var%20url%20=%20window.location;newUrl%20=%20url+"/edit";window.location.replace(newUrl);">Edit Post!</a><br /><br />It will append <code>/edit</code> to the url and reload, so you can edit your post<br /><br />— Built with ❤ by <a href="http://curiositry.github.io">@curiositry</a> (<a href="http://twitter.com/curiositry">Twitter</a>, <a href="http://github.com/curiositry">GitHub</a>)
http://www.copyio.com/ghost-template-bookmarklet/

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

sudo apt update
sudo apt install ssh screen build-essential git \
nfs-common nfs-kernel-server samba
sudo apt purge docker.io docker-compose docker-registry systemd-docker;
# Install docker-compose and docker
sudo wget https://github.com/docker/compose/releases/download/1.8.0/docker-compose-`uname -s`-`uname -m` -O /usr/local/bin/docker-compose;
sudo chmod +x /usr/local/bin/docker-compose;
@bhgraham
bhgraham / debmigrate
Last active August 29, 2015 14:16
Migrate all installed packages between debian based machines.
#!/bin/bash
#
# Author: Benjamin H. Graham (me@bman.io)
# Copyright: 2015 Administr8 (http://administr8.me)
# License : GNU GPL v2 (http://www.gnu.org/licenses/gpl-2.0.html)
# dump packages to pastebin, return hash
# restore packages from pastebin with hash input
VERSION="1.0.0";
@bhgraham
bhgraham / install_dockerdeb
Created December 31, 2014 02:01
Quick Install for Docker on Debian (LMDE, Mint, Ubuntu, etc)
# Quick Install for Docker on Debian (LMDE, Mint, Ubuntu, etc)
# Author: Benjamin H. Graham <bman@bman.io>
# Usage: curl -s bman.io/i/install_dockerdeb | bash
# Add debian repo
echo "Adding the debian repository for docker"
echo deb http://get.docker.io/ubuntu docker main | sudo tee /etc/apt/sources.list.d/docker.list
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
echo "Updating apt repos"
sudo apt-get update -qq
@bhgraham
bhgraham / install_dockermac
Created December 31, 2014 01:57
Quick Install for Docker on Mac OSX
# Quick Install for Docker on Mac OSX
# Author: Benjamin H. Graham <bman@bman.io>
# Must be run as root
# Usage: curl -s bman.io/i/install_dockermac|sudo bash
cd ~
echo "Downloading docker binary";
curl -Ls "https://github.com/boot2docker/osx-installer/releases/download/v1.2.0/Boot2Docker-1.2.0.pkg" -o "Boot2Docker-1.2.0.pkg";
echo "Installing docker service";
installer -pkg Boot2Docker-1.2.0.pkg -target /;
@bhgraham
bhgraham / 0_reuse_code.js
Created August 17, 2014 03:24
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
@bhgraham
bhgraham / projects.rb
Created February 14, 2013 09:09
gitlab/lib/api/projects.rb only changed the lines mentioning namespace_id. these were added to allow project creation within namespace (from API). If not used, it defaults to your username. This allows gh2gl to work "git clone http://code.a8.lc/administr8/github2gitlab.git" for github to gitlab migrations.
# Create new project
#
# Parameters:
# name (required) - name for new project
# description (optional) - short project description
# default_branch (optional) - 'master' by default
# issues_enabled (optional) - enabled by default
# wall_enabled (optional) - enabled by default
# merge_requests_enabled (optional) - enabled by default
# wiki_enabled (optional) - enabled by default
@bhgraham
bhgraham / gitlab.sh
Last active December 12, 2015 09:39 — forked from cristianrasch/gitlab.sh
aptitude install -y git curl python-dev python-pip redis-server ruby1.9.1-full rubygems1.9.1
ln -s /usr/bin/ruby /usr/local/bin/ruby
ln -s /usr/bin/gem1.9.1 /usr/local/bin/gem
rm /usr/bin/ruby /usr/bin/gem
aptitude install -y mysql-server libmysqlclient-dev
adduser --system --shell /bin/sh --gecos 'git version control' --group --disabled-password --home /home/git git
adduser --disabled-login --gecos 'gitlab system' gitlab
usermod -a -G git gitlab
su - gitlab
ssh-keygen -q -N '' -t rsa -f /home/gitlab/.ssh/id_rsa