Skip to content

Instantly share code, notes, and snippets.

@Rich-Harris
Rich-Harris / README.md
Last active November 10, 2020 15:49
Svelte vs Knockout
@gibson042
gibson042 / github-expand-previous.png
Last active May 1, 2019 22:27
GitHub Expand Previous user script
github-expand-previous.png
@pmocek
pmocek / gist:8a4163ee0d1ce402d27352787d89bad0
Last active May 24, 2018 14:48
Short-term car rental business accepts image of face, but not actual face, as identification
Following are quotes from an e-mail exchange between Car2go representatives
Alexus, Sarah, and Jessica, and Car2go customer Phil Mocek between
2017-10-19 and 2017-10-24:
C2> It looks like your driver's license information is not up-to-date in our
C2> system, so we had to lock your account temporarily.
PM> Your system's information is outdated. My Washington driver license will
PM> expire in September of 2019.
#!/bin/bash
## Setup a delay
sudo dnctl -q flush
sudo dnctl -q pipe flush
sudo dnctl pipe 1 config delay 0ms noerror
sudo dnctl pipe 2 config delay 0ms noerror
sudo pfctl -f pfctl.rules
sudo dnctl pipe 1 config bw 780Kbit/s delay 100ms
sudo dnctl pipe 2 config bw 330Kbit/s delay 100ms
@tomtorggler
tomtorggler / api-posts.html
Created March 31, 2017 15:56
Create JSON objects for all posts on a Jekyll site
---
# Requires Front Matter
---
{"items":[{% for post in site.posts %}{
"title": {{post.title | jsonify}},
"url": {{ post.url | prepend: site.baseurl | prepend: site.url | jsonify }},
"date": {{ post.date | date: '%B %-d, %Y' | jsonify }},
"category": {{ post.category | jsonify }},
"tags": {{ post.tags | jsonify }},
"author": {{ post.author | jsonify }},
@libitte
libitte / gist:cbde168d26bc5faf9bf9fef648091b42
Last active November 11, 2022 19:30
FIX warning: ignoring broken ref refs/remotes/origin/HEAD

warning: ignoring broken ref refs/remotes/origin/HEAD


➜   ✗ g symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/develop
➜   ✗ g fetch --prune
➜   ✗ g gc

@potatoqualitee
potatoqualitee / no-bright-blue-github.css
Last active March 2, 2017 02:04
Stylebot CSS for the good ol' gentle blue colors of GitHub
h1.public strong a {
color: #4078C0;
}
a.subnav-item.js-subnav-item.selected {
background-color: #4078C0;
}
svg.octicon.octicon-file-directory path {
color: #4078C0;
@chrisveness
chrisveness / crypto-aes-gcm.js
Last active May 6, 2024 19:16
Uses the SubtleCrypto interface of the Web Cryptography API to encrypt and decrypt text using AES-GCM (AES Galois counter mode).
/**
* Encrypts plaintext using AES-GCM with supplied password, for decryption with aesGcmDecrypt().
* (c) Chris Veness MIT Licence
*
* @param {String} plaintext - Plaintext to be encrypted.
* @param {String} password - Password to use to encrypt plaintext.
* @returns {String} Encrypted ciphertext.
*
* @example
* const ciphertext = await aesGcmEncrypt('my secret text', 'pw');
@aryzhov
aryzhov / example.yaml
Last active January 26, 2024 11:44
YAML array extention in Python
CoreTeam: &CoreTeam
Characters:
- Mario
- Luigi
ExtendedTeam: &ExtendedTeam
<<: *CoreTeam
Characters+:
- Princess Peach
- Yoshi
// This is my solution to the "Little JavaScript Problem" from http://lisperator.net/blog/a-little-javascript-problem/
// Apparently this means Mihai Bazon will hire me... Woo!
var pair = (head, tail) => (f => f(head, tail))
var car = (pair) => pair((head, tail) => head)
var cdr = (pair) => pair((head, tail) => tail)
var range = (min, max) => pair(min, min == max ? null : range(min + 1, max))
var map = (list, func) => pair(func(car(list)), cdr(list) === null ? null : map(cdr(list), func))
var reverse = (list, newList=null) => list === null ? newList : reverse(cdr(list),pair(car(list), newList))
var foreach = (list, func) => list === null ? null : (func(car(list)), foreach(cdr(list), func))