Skip to content

Instantly share code, notes, and snippets.

@ping
ping / bookmarklet.js
Last active January 13, 2023 13:53
Bookmarklet to add download links for audiobooks in the Overdrive loans page
/* 1. Paste this entire gist over at https://mrcoles.com/bookmarklet/ to generate a bookmarklet */
/* 2. Use a meaningful Name like: 🎧 📖 Links */
/* 3. Drag the generated bookmarklet link to your Bookmarks Toolbar. */
/* 4. Click on the bookmarklet when you're on the Overdrive loan page, e.g. https://yourlibrary.overdrive.com/account/loans */
/* 5. The "Download MP3 audiobook" link should appear like it used to. */
$('a[data-format-id="audiobook-overdrive"]').each(function() {
var listenBtn = $(this);
if (listenBtn.hasClass('script-added')) {
@elasticdog
elasticdog / vault-cp
Created July 27, 2018 18:32
A script to copy Vault secrets from one path to another
#!/usr/bin/env bash
# ensure we were given two command line arguments
if [[ $# -ne 2 ]]; then
echo 'usage: vault-cp SOURCE DEST' >&2
exit 1
fi
source=$1
dest=$2
@aoberoi
aoberoi / CLA.md
Last active February 18, 2021 15:42
Slack Technologies, Inc. - Individual Contributor License Agreement (CLA)

Slack Individual Contributor License Agreement

Each individual submitting Contributions (as defined below) to Slack Technologies, Inc. (“Slack”) for inclusion in, or documentation of, any of the products owned or managed by Slack (the "Work"), must sign a Contributor License Agreement ("CLA") prior to submitting such Contributions to Slack. This CLA clarifies the intellectual property license You (as defined below) grant to Slack, and is for Your protection as a Contributor as well as the protection of Slack; it does not change Your rights to use Your own Contributions for any other purpose.

You acknowledge and agree that this CLA is in addition to the obligations You have under the MIT license (together, the “Agreement”), and You accept and agree to the following terms and conditions for Your present and future Contributions submitted to Slack. Except for the license granted herein to Slack and recipients of software distributed by Slack, You reserve all right, title, and interest in and to Your Contribu

@mjnaderi
mjnaderi / install-arch.md
Last active April 18, 2024 19:00 — forked from mattiaslundberg/arch-linux-install
Installing Arch Linux with Full Disk Encryption (LVM on LUKS)

Installing Arch Linux with Full Disk Encryption

If you're aiming for a seamless Arch Linux installation in UEFI mode, follow along as this guide will walk you through the process step by step. We'll be using LUKS (Linux Unified Key Setup) and LVM (Logical Volume Manager) partitions on LUKS to achieve full disk encryption.

Note: I have updated this doc for UEFI mode. For those with BIOS/MBR systems, you can refer to the previous version, but keep in mind that it might be outdated and no longer accurate.

If you're only interested in installing Linux and not setting up dual boot with Windows, feel free to skip the Windows-related sections.

@chrismdp
chrismdp / s3.sh
Last active March 5, 2024 12:57
Uploading to S3 in 18 lines of Shell (used to upload builds for http://soltrader.net)
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine
# This is how I upload my new Sol Trader builds (http://soltrader.net)
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
S3KEY="my aws key"
S3SECRET="my aws secret" # pass these in
function putS3
{
path=$1
@h12w
h12w / goclean.sh
Last active August 24, 2021 03:13
golcean.sh does automatic checking on a Go package and its sub-packages.
#!/bin/bash
# The script does automatic checking on a Go package and its sub-packages, including:
# 1. gofmt (http://golang.org/cmd/gofmt/)
# 2. goimports (https://github.com/bradfitz/goimports)
# 3. golint (https://github.com/golang/lint)
# 4. go vet (http://golang.org/cmd/vet)
# 5. race detector (http://blog.golang.org/race-detector)
# 6. test coverage (http://blog.golang.org/cover)
set -e
// jshint unused:false
/* global console */
var num = 1,
flt = 2.1,
neg = -1,
hex = 0xFF2200,
octal = -01234,
nan = NaN,
nll = null,
@rcrowley
rcrowley / statebird.sh
Created July 18, 2013 15:04
How to get a reservation at State Bird Provisions
set -e
mail() {
echo "$@" |
/usr/bin/mail -a"From: Richard Crowley <r@rcrowley.org>" -s"State Bird Provisions" "1234567890@vtext.com"
echo "$(date): there was a reservation!" >&2
}
TMP="$(mktemp)"
trap "mail \"FAILURE\"; rm -f \"$TMP\"" EXIT INT QUIT TERM
@creationix
creationix / run.js
Last active November 27, 2017 16:06
A tiny generator helper for consuming callback code directly
function run(generator) {
var iterator = generator(resume);
var data = null, yielded = false;
iterator.next();
yielded = true;
check();
function check() {
while (data && yielded) {
@Protonk
Protonk / prng.js
Last active April 7, 2023 09:30
Various PRNGs, implemented in javascript.
// Linear Congruential Generator
// Variant of a Lehman Generator
var lcg = (function() {
// Set to values from http://en.wikipedia.org/wiki/Numerical_Recipes
// m is basically chosen to be large (as it is the max period)
// and for its relationships to a and c
var m = 4294967296,
// a - 1 should be divisible by m's prime factors
a = 1664525,
// c and m should be co-prime