Skip to content

Instantly share code, notes, and snippets.

@paragonie-scott
paragonie-scott / crypto-wrong-answers.md
Last active August 17, 2024 06:33
An Open Letter to Developers Everywhere (About Cryptography)
@NYKevin
NYKevin / accounting.sql
Last active November 14, 2024 15:25
Basic double-entry bookkeeping system, for PostgreSQL.
CREATE TABLE accounts(
id serial PRIMARY KEY,
name VARCHAR(256) NOT NULL
);
CREATE TABLE entries(
id serial PRIMARY KEY,
description VARCHAR(1024) NOT NULL,
amount NUMERIC(20, 2) NOT NULL CHECK (amount > 0.0),
-- Every entry is a credit to one account...
@namuol
namuol / INSTALL.md
Last active July 24, 2023 11:53
rage-quit support for bash

rage-quit support for bash

HOW TO INSTALL

Put flip somewhere in your $PATH and chmod a+x it.

Copy fuck into ~/.bashrc.

@jvns
jvns / blogs.md
Last active April 16, 2020 09:34
Tech blogs I subscribe to
@shaldengeki
shaldengeki / sabretooth-llamaguy-tagd.md
Created December 25, 2013 18:29
Sabretooth and LlamaGuy's descriptions of how tagd works on ETI

Sabretooth

Anyway, we do use a custom service written in C++ that holds all of the tag data in-memory. Each tag holds ordered set of topic IDs. The order is by last post time and then by topic ID for tie breaking; this ordering is consistent between different tags, which gets important later. If you iterate through one of these sets you'll get all the topics tagged with that tag, most recently updated to least recently updated.

Tags also define and implement a very simple cursor interface. This interface is basically three functions; "advance the cursor by one topic", "advance the iterator until it's pointing to or past this topic (passing in a reference topic)", and "give me the currently pointed-to topic". When you are talking to the service, you can say "skip 50 topics and then give me 50 topics", and it will advance the cursor 50 times and throw away the result, and then advance the cursor 50 more times while returning each result. Pretty straightforward.

The cursor interface is also implemen

@folone
folone / gist:6089236
Last active October 10, 2020 18:26
Table of unicode operators in scalaz 6.0.x
@realModusOperandi
realModusOperandi / 2fast2fizzbuzz.c
Last active November 9, 2022 07:46
May I present.... PARALLEL FIZZBUZZ (with no safeties).
//
// main.c
// 2fast2fizzbuzz
//
#include <stdio.h>
#include <pthread.h>
#include <sched.h>
typedef struct {
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active November 5, 2024 18:44
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@tvlooy
tvlooy / feestdagen.php
Last active March 25, 2024 21:40
Feestdagen berekenen
<?php
// (c) Tom Van Looy <[email protected]> https://ctors.net/isc_license.txt
// Alle feestdagen kunnen berekend worden, de berekende zijn allemaal
// afhankelijk van pasen. PHP heeft een functie easter_date().
// Makkie dus. Hoe easter_date() zelf werkt kan je hier raadplegen:
// https://github.com/php/php-src/blob/master/ext/calendar/easter.c
// Geen parameter? Doen we gewoon dit jaar toch.
@timsavery
timsavery / Ruby Download Parse JSON
Created January 22, 2012 15:19
Example For Downloading and Parsing JSON (Ruby)
require "rubygems"
require "json"
require "net/http"
require "uri"
uri = URI.parse("http://api.sejmometr.pl/posiedzenia/BZfWZ/projekty")
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Get.new(uri.request_uri)