Skip to content

Instantly share code, notes, and snippets.

View timmarinin's full-sized avatar

Tim Marinin timmarinin

View GitHub Profile
@aengelberg
aengelberg / csbnf.clj
Last active September 1, 2018 17:23
*slaps roof of parser*
(ns alex.csbnf
"Framework for writing parsers using CSBNF (Car Salesman Backus-Naur Form) notation."
(:require
[instaparse.combinators :as c]
[instaparse.core :as insta]))
(def csbnf-parser
(insta/parser
"grammar = rule+
@zachrose
zachrose / reserved-words.txt
Created November 28, 2015 05:46
URL paths to reserve in a web app
about
admin
blog
calendar
contact
copyright
dashboard
email
errors
events
@kennwhite
kennwhite / vpn_psk_bingo.md
Last active February 24, 2024 12:19
Most VPN Services are Terrible

Most VPN Services are Terrible

Short version: I strongly do not recommend using any of these providers. You are, of course, free to use whatever you like. My TL;DR advice: Roll your own and use Algo or Streisand. For messaging & voice, use Signal. For increased anonymity, use Tor for desktop (though recognize that doing so may actually put you at greater risk), and Onion Browser for mobile.

This mini-rant came on the heels of an interesting twitter discussion: https://twitter.com/kennwhite/status/591074055018582016

@nolanlawson
nolanlawson / protips.js
Last active February 4, 2024 18:06
Promise protips - stuff I wish I had known when I started with Promises
// Promise.all is good for executing many promises at once
Promise.all([
promise1,
promise2
]);
// Promise.resolve is good for wrapping synchronous code
Promise.resolve().then(function () {
if (somethingIsNotRight()) {
throw new Error("I will be rejected asynchronously!");
(function(){
function alerts(msg) {
return new Promise(function(resolve){
div.innerHTML = msg;
div.style.display = "block";
div.onclick = function(){
div.style.display = "none";
resolve();
};
});