Skip to content

Instantly share code, notes, and snippets.

View mtodd's full-sized avatar
🔐
[redacted]

Matt Todd mtodd

🔐
[redacted]
View GitHub Profile
require 'active_support/all'
require 'active_record'
require 'logger'
ActiveRecord::Base.logger = Logger.new(STDOUT)
spec = { 'test' => {adapter: 'sqlite3', database: ':memory:'},
'test_readonly' => {adapter: 'sqlite3', database: ':memory:'},
'shared_test' => {adapter: 'sqlite3', database: ':memory:'},
'shared_test_readonly' => {adapter: 'sqlite3', database: ':memory:'}
@brunophilipe
brunophilipe / gist:c0798411e6a405982435e85ed23b1fb3
Created April 11, 2016 15:58
Google Static Maps API Call
https://maps.googleapis.com/maps/api/staticmap?size=576x576&zoom=12&center=41.386162%2C%202.172800&style=feature%3Aall%7Cvisibility%3Aoff&style=feature%3Aroad%7Celement%3Ageometry%7Ccolor%3A0x000000%7Csaturation%3A0%7Cweight%3A0.2%7Cvisibility%3Aon&scale=2&key=YOUR_API_KEY
@shagunsodhani
shagunsodhani / TAO.md
Created February 28, 2016 19:33
Notes on TAO: Facebook’s Distributed Data Store for the Social Graph

TAO

  • Geographically distributed, read-optimized, graph data store.
  • Favors availability and efficiency over consistency.
  • Developed by and used within Facebook (social graph).
  • Link to paper.

Before TAO

  • Facebook's servers directly accessed MySQL to read/write the social graph.
@vasanthk
vasanthk / System Design.md
Last active April 24, 2025 13:48
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
require 'rack'
# Track changes in rack requests and responses made by middleware.
#
# SomeMiddleware
# request: ...
# response: ...
# AnotherMiddleware
# request: ...
# response: ...
#![feature(lang_items, asm)]
#![crate_type = "staticlib"]
#![no_std]
const GPIO_BASE: u32 = 0x3F000000;
const GPIO_SET: u32 = 0x3F200020;
const GPIO_CLR: u32 = 0x3F20002C;
const GPIO47: u32 = 0x8000;
fn sleep(value: u32){
@fitnr
fitnr / systems.json
Created December 2, 2015 14:48
rapid transit systems included in http://fakeisthenewreal.org/subway
[
{
"city": "Amsterdam",
"urls": [
{
"link": "GVB",
"url": "http://www.gvb.nl/"
}
]
},
@fasterthanlime
fasterthanlime / state-of-emergency-in-france.md
Last active March 26, 2021 21:29
What the state of emergency means in France, where it's been declared following the Paris attacks
@blithe
blithe / .zshrc
Last active October 5, 2015 16:03 — forked from burtlo/.zshrc
This is a shortcut to change into my journal directory, create a new article, and then immediately start editing it.
read () {
open "http://blitherocher.com"
}
article () {
# change in to the directory where I keep my journal project
cd /projects/personal_projects/personal_site
echo "Creating article '$@'"
@CAFxX
CAFxX / persistent_pipes_linux.md
Last active September 2, 2024 12:08
Persistent pipes/circular buffers for Linux

📂 Persistent "pipes" in Linux

In a project I'm working on I ran into the requirement of having some sort of persistent FIFO buffer or pipe in Linux, i.e. something file-like that could accept writes from a process and persist it to disk until a second process reads (and acknowledges) it. The persistence should be both across process restarts as well as OS restarts.

AFAICT unfortunately in the Linux world such a primitive does not exist (named pipes/FIFOs do not persist