Skip to content

Instantly share code, notes, and snippets.

View jgillman's full-sized avatar

Joel Gillman jgillman

View GitHub Profile
@imjasonh
imjasonh / markdown.css
Last active May 24, 2024 22:56
Render Markdown as unrendered Markdown (see http://jsbin.com/huwosomawo)
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}
@kotay
kotay / formatter.rb
Last active January 25, 2022 07:32
Heroku to Logstalgia formatter
#!/usr/bin/env ruby
# Install:
# $ cat heroku_logstalgia_formatter.rb > ~/bin/heroku_logstalgia_formatter
# $ chmod +x ~/bin/heroku_logstalgia_formatter
# Usage:
# $ heroku logs -t --app {app} | heroku_logstalgia_formatter | logstalgia -
require 'optparse'
@tommarshall
tommarshall / simple_form.rb
Created August 22, 2013 14:58 — forked from clyfe/simple_form.rb
Bootstrap3 compatible simple_form initializer (with consistent Bootstrap 3 classes)
# http://stackoverflow.com/questions/14972253/simpleform-default-input-class
# https://github.com/plataformatec/simple_form/issues/316
inputs = %w[
CollectionSelectInput
DateTimeInput
FileInput
GroupedCollectionSelectInput
NumericInput
PasswordInput
@stengland
stengland / routes.rb
Created August 2, 2013 17:44
External URLs in rails routes
MyApp::Application.routes.draw do
# External urls
scope host: 'www.example.com' do
get 'thing' => 'dev#null', as: :thing
end
end
# Use thing_url in your veiws (thing_path would not include the host)
# thing_url => "http://www.example.com/thing"
@quad
quad / hey.rb
Created December 8, 2012 19:04
hey! a minimalist CRM
#!/usr/bin/env ruby
#
# hey! a minimalist CRM for http://todotxt.com/
#
# hey tells you one thing you should do regularly, but haven't done lately.
#
# $ todo.sh lf hey
# 1 @phone Mom (+1 234 567 8901) +family
# 2 @skype Dad +family
# 3 @email mentor
@jgillman
jgillman / global.scss
Created May 31, 2012 16:40
My Reusable Sass Mixins
@mixin truncate {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
@mixin prefixify($style, $params) {
-webkit-#{$style}: $params;
-moz-#{$style}: $params;
-ms-#{$style}: $params;
@jboner
jboner / latency.txt
Last active June 8, 2024 07:35
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
@aemkei
aemkei / LICENSE.txt
Last active June 4, 2024 07:51 — forked from 140bytes/LICENSE.txt
Binary Tetris - 140byt.es
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@qrush
qrush / Inconsolata-dz-Powerline.otf
Created January 11, 2012 16:50
vim-powerline patched fonts
@rsvp
rsvp / noise.sh
Last active April 18, 2024 14:18
noise : relaxing ambient Brown noise generator (cf. white noise) | Linux bash script using sox | CogSci notes
#!/usr/bin/env bash
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2019-01-02
#
# _______________| noise : ambient Brown noise generator (cf. white noise).
#
# Usage: noise [minutes=59] [band-pass freq center=1786] [wave]
# ^minutes can be any positive integer.
# Command "noise 1" will display peak-level meter.
#
# Dependencies: play (from sox package)