Skip to content

Instantly share code, notes, and snippets.

View brandongalbraith's full-sized avatar

B brandongalbraith

  • North America
View GitHub Profile
@brandongalbraith
brandongalbraith / pocket_exporter.py
Created November 6, 2018 03:15 — forked from jasonrdsouza/pocket_exporter.py
Export archived article data from Pocket
'''This script can be used to export data from Pocket (getpocket.com)
Uses include migrating to a different "read it later" service, saving
specific articles to another service, backing up your reading history,
and more.
Currently it can be used to export links and metadata for archived
articles with a given tag, which are more recent than a given timestamp.
An example use case is to export all articles you have tagged as
"to-export", which are newer than 10 days old. The timestamp functionality
@brandongalbraith
brandongalbraith / detect-private-browsing.js
Created April 3, 2018 20:18 — forked from cou929/detect-private-browsing.js
Detect private browsing mode (InPrivate Browsing or Incognito).
function retry(isDone, next) {
var current_trial = 0, max_retry = 50, interval = 10, is_timeout = false;
var id = window.setInterval(
function() {
if (isDone()) {
window.clearInterval(id);
next(is_timeout);
}
if (current_trial++ > max_retry) {
window.clearInterval(id);
@brandongalbraith
brandongalbraith / aws-s3-bucket-policy-tls-kms-enforcement.json
Last active March 8, 2018 16:14
AWS S3 Bucket Policy: Require TLS for data transport, enforce object encryption using any KMS key
{
"Version": "2012-10-17",
"Id": "PolicyIdentifierGUIDgoesHere",
"Statement": [{
"Action": "s3:*",
"Effect": "Deny",
"Principal": "*",
"Resource": "arn:aws:s3:::<bucketname>",
"Condition": {
"Bool": {
@brandongalbraith
brandongalbraith / fr-set-down.py
Created February 20, 2018 20:26 — forked from zmwangx/fr-set-down.py
Python script to download entire photosets (original quality) on Flickr. #flickr
#!/usr/bin/env python
import subprocess
import sys
# pip install flickrapi
# project home: http://stuvel.eu/flickrapi
import flickrapi
api_key = '00000000000000000000000000000000' # obtain your api key at http://www.flickr.com/services
@brandongalbraith
brandongalbraith / osx_ramdisk.sh
Created January 14, 2018 18:57 — forked from jnschulze/osx_ramdisk.sh
Move Chrome, Safari and iTunes Cache to Ramdisk.
#!/bin/bash
# Size at the end is * 2048 where 2048 = 1 MB, so 1572864 = 768 MB
#DISK=`/usr/bin/hdiutil attach -nobrowse -nomount ram://1572864`
DISK=`/usr/bin/hdiutil attach -nobrowse -nomount ram://2097152`
/usr/sbin/diskutil erasevolume HFS+ "RamDiskCache" $DISK
CACHEDIR="/Volumes/RamDiskCache/$USER"
#!/usr/bin/env bash
#
# Clean up an instance so packer can bake an AMI from it.
#
# Copyright 2017, Jiff Inc
# License: Apache 2.0
set -o pipefail
if [ ! -z "${DEBUG}" ]; then
@brandongalbraith
brandongalbraith / README.md
Created August 5, 2016 03:48 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


Index:

@brandongalbraith
brandongalbraith / examples.txt
Created July 6, 2016 15:47 — forked from brickZA/examples.txt
Tests for quoting with fabric.contrib.files.append. original.txt is generated using 6c483ef261ab8ed243b39a337b0382a8c84e5994, patched version using 6d91ffff8cb1c9ed468475a6ca4d167751f4dff0
test (one)
test '(' \ ) two
test "'three)' '' the
test \'a\'$ four
test ""'""'' five
^six $(('")"((thing)it's)'\'')'' test$
_test%(seven')')
@brandongalbraith
brandongalbraith / company-ownership.md
Created July 6, 2016 02:56 — forked from jdmaturen/company-ownership.md
Who pays when startup employees keep their equity?

Who pays when startup employees keep their equity?

JD Maturen, 2016/07/05, San Francisco, CA

As has been much discussed, stock options as used today are not a practical or reliable way of compensating employees of fast growing startups. With an often high strike price, a large tax burden on execution due to AMT, and a 90 day execution window after leaving the company many share options are left unexecuted.

There have been a variety of proposed modifications to how equity is distributed to address these issues for individual employees. However, there hasn't been much discussion of how these modifications will change overall ownership dynamics of startups. In this post we'll dive into the situation as it stands today where there is very near 100% equity loss when employees leave companies pre-exit and then we'll look at what would happen if there were instead a 0% loss rate.

What we'll see is that employees gain nearly 3-fold, while both founders and investors – particularly early investors – get dilute

@brandongalbraith
brandongalbraith / GitHub curl.sh
Created May 17, 2016 20:05 — forked from Integralist/GitHub curl.sh
Download a single file from a private GitHub repo. You'll need an access token as described in this GitHub Help article: https://help.github.com/articles/creating-an-access-token-for-command-line-use
curl --header 'Authorization: token INSERTACCESSTOKENHERE' \
--header 'Accept: application/vnd.github.v3.raw' \
--remote-name \
--location https://api.github.com/repos/owner/repo/contents/path
# Example...
TOKEN="INSERTACCESSTOKENHERE"
OWNER="BBC-News"
REPO="responsive-news"