Skip to content

Instantly share code, notes, and snippets.

View bmoelk's full-sized avatar

Brian Moelk bmoelk

  • Brain Endeavor LLC
  • San Diego
View GitHub Profile
@x-yuri
x-yuri / docker + supercronic.md
Last active March 23, 2024 23:02
docker + supercronic

docker + [supercronic][a]

Use [-debug][d] to make it more verbose.

docker-compose.yml:

services:
  supercronic:
 build: .
@jennyknuth
jennyknuth / README.md
Last active March 19, 2024 20:16
Transform an SVG into a data URI—best practice

How to transform an SVG into a data URI

by Jenny Knuth, based on the work of Chris Coyier and Taylor Hunt

A data URI is a nice way to include a web resource without needing to make an HTTP request. Chris Coyier explains the technique nicely in Probably Don't Base64 SVG.

While a PNG might use Base64 encoding, for SVG, there is a better way.

Taylor Hunt's experiments led to this solution for optimizing SVGs in data URIs:

"So the best way of encoding SVG in a data URI is data:image/svg+xml,[actual data]. We don’t need the ;charset=utf-8 parameter (or the invalid ;utf8 parameter…), because URLs are always ASCII."

@jboner
jboner / latency.txt
Last active May 4, 2024 18:45
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@sdb
sdb / .gitignore
Created April 29, 2012 16:03
Simple debugging SMTP server with Node.js
node_modules
@rbxbx
rbxbx / incrudable.rb
Created March 3, 2011 14:35
CRUD with decent_exposure
# pulled out of a project authored by tpope && rbxbx
# not generic enough for general use, but a decent example of
# an application specific restful crud abstraction
module Incrudable
extend ActiveSupport::Concern
included do
expose(controller_name) { controller_name.classify.constantize.scoped }
expose(controller_name.singularize)