Skip to content

Instantly share code, notes, and snippets.

@davidgilbertson
davidgilbertson / http2.js
Last active October 9, 2023 06:09
HTTP2 server with compression and caching
const http2 = require('http2');
const fs = require('fs');
const path = require('path');
const zlib = require('zlib');
const brotli = require('brotli'); // npm package
const PORT = 3032;
const BROTLI_QUALITY = 11; // slow, but we're caching so who cares
const STATIC_DIRECTORY = path.resolve(__dirname, '../dist/');
const cache = {};
@bergie
bergie / README.md
Created May 18, 2011 11:33
Falsy Values tutorials
@vmunix
vmunix / mysql_pid_fslatency_slowlog0.d
Created April 24, 2011 05:33
MySQL slow queries caused by filesystem latency
#!/usr/sbin/dtrace -s
/*
* mysqld_pid_fslatency_slowlog0.d Print slow filesystem I/O events.
*
* USAGE: ./mysql_pid_fslatency_slowlog0.d mysqld_PID
*
* This traces all mysqld filesystem I/O (including some that may be
* asynchronous to queries and not causing query latency), and prints
* those individual I/O taking longer than the MIN_FS_LATENCY_MS tunable.
*
/* CSS */
$height: 85px;
$width: 700px;
.container { position: relative }
.card {
height: $height;
width: $width;
z-index: 1;
@ctrochalakis
ctrochalakis / dalton.rb
Created June 11, 2010 12:17
facebook, google, twitter, yahoo warden strategies
require 'dalton/strategies/skroutz'
require 'dalton/strategies/facebook'
require 'dalton/strategies/openid' # yahoo, #google
require 'dalton/strategies/twitter'
# Setup OpenId file storage, don't change the storage engine!
require 'openid/store/filesystem'
Rails.configuration.middleware.use(Rack::OpenID,
OpenID::Store::Filesystem.new(Rails.root + 'tmp/openid'))