Skip to content

Instantly share code, notes, and snippets.

@alane019
alane019 / clear-watch-later-playlist.js
Last active February 26, 2024 07:16
Delete remove all videos from Youtube "Watch Later" playlist (working as of 12/14/2020)
// This script can be used to clear all videos from youtube's built-in "watch later" playlist which has a limit of 5,000 videos.
// Without this, you would need to click the remove button on each video in the list.
// Youtube made changes recently that caused errors for a previously working script.
// Script written by: janthedeveloper (https://github.com/JanTheDeveloper)
// Bookmark wrapper added by: shelldonhull (https://github.com/sheldonhull)
// Full conversation here: https://gist.github.com/astamicu/eb351ce10451f1a51b71a1287d36880f#file-readme-md
// 1. Save the javascript text below as a bookmark in google chrome(Simply replace the URL field in any existing bookmark, and give the bookmark any name)
@quiver
quiver / iam-policy.json
Last active April 23, 2024 07:02
How to connect to Amazon RDS PostgreSQL with IAM credentials
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"rds-db:connect"
],
"Resource": [
"arn:aws:rds-db:region:account-id:dbuser:dbi-resource-id/database-user-name"
@yossorion
yossorion / what-i-wish-id-known-about-equity-before-joining-a-unicorn.md
Last active April 7, 2024 22:55
What I Wish I'd Known About Equity Before Joining A Unicorn

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

@jdmaturen
jdmaturen / company-ownership.md
Last active July 29, 2023 22:39
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

@saliceti
saliceti / pre-commit
Last active March 12, 2021 18:38
Git pre-commit hook to check for AWS keys
#!/usr/bin/env bash
# Install globally using https://coderwall.com/p/jp7d5q/create-a-global-git-commit-hook
# The checks are simple and can give false positives. Amend the hook in the specific repository.
if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
# Initial commit: diff against an empty tree object
require 'date'
require 'nokogiri'
require 'rest-client'
require 'reverse_markdown'
# Match [caption <stuff>]...[/caption] tags
# example: http://rubular.com/r/r2FH3QSOpL
CAPTION_REGEX = /\[caption.*\](?=.*\[)|\[\/caption\]/
@koelling
koelling / gist:ef9b2b9d0be6d6dbab63
Last active February 7, 2017 16:21
CVE-2015-0235 (GHOST) test code
#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#define CANARY "in_the_coal_mine"
struct {
char buffer[1024];
@karmi
karmi / .gitignore
Last active November 12, 2022 12:11
Example Nginx configurations for Elasticsearch (https://www.elastic.co/blog/playing-http-tricks-nginx)
nginx/
!nginx/.gitkeep
!nginx/logs/.gitkeep
src/
tmp/
#!/bin/bash
JQPATH=$(which jq)
if [ "x$JQPATH" == "x" ]; then
echo "Couldn't find jq executable." 1>&2
exit 2
fi
set -eu
shopt -s nullglob
@kris-lab
kris-lab / gist:2991b31064da1353a277
Last active August 29, 2015 14:05
Hiera mongodb cluster config
{
"puppet::common::basemodulepath": "/etc/puppet/modules:/tmp/vagrant-puppet-2/modules-0:/tmp/vagrant-puppet-2/modules-1",
"puppet::agent::server": "master.sandbox",
"puppet::agent::cpu_shares": "1024",
"network::host::advertise::interface" : "eth1",
"company::mongodb::cluster_config": {
"members": {