Skip to content

Instantly share code, notes, and snippets.

View cdl's full-sized avatar

Colby Ludwig cdl

View GitHub Profile
@benjaminplee
benjaminplee / mine_git.sh
Created December 19, 2011 14:39
git commit mining scripts
git log --shortstat --format=format:"%cd" --date=short --no-merges | sed -e '/^$/d;N;s/\n//;s/files changed, //;s/insertions(+), //;s/ deletions(-)//'
just delta info:
git log --shortstat --format=format:"" --no-merges --all | sed '/^$/d;s/[a-z()+,-]//g'
git log --format=format:"%cd" --date=short --no-merges --all | wc -l
num commits total
git log --format=format:"%cd" --date=short --no-merges --all | uniq -c
num commits for each day
@visnup
visnup / listenOnPortOrSocketFile.js
Last active May 17, 2019 11:57
Listen on a TCP port or a UNIX socket file in node.js. Handle EADDRINUSE for the socket file by deleting it and re-listening.
var fs = require('fs')
, net = require('net')
, http = require('http')
, port = process.env.PORT;
var app = function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
};
@lukespragg
lukespragg / nginx-openssl-build.sh
Last active July 29, 2024 19:15
NGINX and OpenSSL build and installation script
#!/bin/bash
## TODO:
# Figure out how to get nginx file-aio module working (incompatible?)
## Get and install tools and dependencies
sudo apt-get -y install build-essential zlib1g-dev libpcre3 libpcre3-dev libbz2-dev
## Get installed OpenSSL version
# Use `whereis openssl` to check if installed first
@kristianmandrup
kristianmandrup / Converting libraries to Ember CLI addons.md
Last active April 21, 2023 17:14
Guide to Developing Addons and Blueprints for Ember CLI

Converting libraries to Ember CLI addons

In this guide we will cover two main cases:

  • Ember specific library
  • vendor library

Ember library

The Ember library will assume that Ember has already ben loaded (higher in the loading order) and thus will assume it has access to the Ember API.

@cdl
cdl / flac-to-m4a.sh
Created November 7, 2014 21:25
Instructions on converting a folder of FLAC files to ALAC M4A.
# install ffmpeg via homebrew - visit brew.sh if you don't have Homebrew
brew install ffmpeg
# cd to directory of FLAC files
cd /path/to/flacs/
# run the magic one-liner
for i in *.flac; do ffmpeg -i "$i" -acodec alac "`basename "$i" .flac`.m4a"; done;
@searls
searls / github-wiki-override-test-double-style.css
Last active May 11, 2021 16:33
Some CSS that will make Github Wiki content full-screen friendly (useful when presenting). Override with your browser or an extension like greasemonkey or Stylish to apply to the wikis you want.
/* and now with 100% more branding */
body { border: 10px solid #82FA32; min-height: 720px; }
.container { width: inherit; }
.header { display: none; }
.gh-header { padding: 30px 0px 30px 0px; background-color: black; color: white; }
.gh-header-actions { float: inherit; text-align: center; }
.btn-primary { border-color: #000; background-image: linear-gradient(#333, #000); }
.gh-header-actions .btn { float: inherit; }
.gh-header-title { padding-top: 20px; text-align: center; font-size: 4.2em; margin-right: 0px; font-weight: 100; }
.pagehead { display: none; }
@paulirish
paulirish / what-forces-layout.md
Last active November 19, 2024 08:58
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@anschaef
anschaef / bootstrap-4-sass-mixins-cheat-sheet.scss
Last active April 12, 2024 08:49
Bootstrap 4 Sass Mixins [Cheat sheet with examples]
/* -------------------------------------------------------------------------- */
// All Bootstrap 4 Sass Mixins [Cheat sheet]
// Updated to Bootstrap v4.5.x
// @author https://anschaef.de
// @see https://github.com/twbs/bootstrap/tree/master/scss/mixins
/* -------------------------------------------------------------------------- */
/*
// ########################################################################## */
// New cheat sheet for Bootstrap 5: