Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View colinbendell's full-sized avatar
🦑

Colin Bendell colinbendell

🦑
View GitHub Profile
@tkadlec
tkadlec / perf-diagnostics.css
Last active June 8, 2023 17:47
CSS used to highlight potential performance issues
:root {
--violation-color: red; /* used for clear issues */
--warning-color: orange; /* used for potential issues we should look into */
}
/* IMAGES */
/*
* Lazy-Loaded Images Check
* ====
@jthigh
jthigh / RPi3-TCP-BBR.md
Created December 29, 2019 19:51 — forked from carry0987/RPi3-TCP-BBR.md
Raspberry Pi 3B+ Using BBR Congestion Control

Raspberry Pi 3B+ Using BBR Congestion Control

Check Kernel

uname -r

The kernel version should >= 4.9.4, if isn't, please follow the script below to update kernel:

Update Kernel

  1. sudo rpi-update
  2. sudo reboot
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active April 10, 2024 20:23
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@simonhearne
simonhearne / SPA.js
Last active November 25, 2016 02:01
Custom metric for WebPageTest to detect single page application frameworks
var SPA="none";
if (typeof(app)=="object") SPA = "unknown";
if (window.hasOwnProperty('require')) {
if(window.require.hasOwnProperty('defined')){
if(window.require.defined('troopjs-compose/decorator')) SPA = "troop";
if(window.require.defined('flight/lib/component')) SPA = "flight";
}
}
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@ilake
ilake / gist:2042942
Created March 15, 2012 08:33
metaprograming: define_method, define_singleton_method(1.9)
# base on ruby 1.9
# Reference :
# http://stackoverflow.com/questions/185947/ruby-define-method-vs-def
# define_method is a (private) method of the object Class. You are calling it from an instance. There is no instance method called define_method, so it recurses to your method_missing, this time with :define_method (the name of the missing method), and :screech (the sole argument you passed to define_method).
# http://stackoverflow.com/questions/752717/how-do-i-use-define-method-to-create-class-methods
class Base
def self.meta_instance_method &block
define_method "ins", block
end