Skip to content

Instantly share code, notes, and snippets.

Thorsten Ball mrnugget

View GitHub Profile
mislav /
Last active Dec 22, 2018
Find "*.log" files in your home dir, sort them by fattest-first, and calculate the size of them all together.
find ~ -name '*.log' -print0 | xargs -0 -L1 stat -f'%z %N' | sort -rn | tee fat-logfiles.txt | head
awk '{ total += $1 } END { printf "total: %5.2f MiB\n", total/1024/1024 }' < fat-logfiles.txt
jlongster / gist:1712455
Created Jan 31, 2012
traditional lisp macros
View gist:1712455
;; outlet code for implementing traditional macro expansion
;; macros
(define (expand form)
((variable? form) form)
((literal? form) form)
((macro? (car form))
(expand ((macro-function (car form)) form)))
mislav / OpenSSL
Last active May 9, 2019
Fix OpenSSL certificate errors on Ruby 2.0
View OpenSSL

The reason why you might get certificate errors in Ruby 2.0 when talking HTTPS is because there isn't a default certificate bundle that OpenSSL (which was used when building Ruby) trusts.

Update: this problem is solved in edge versions of rbenv and RVM.

$ ruby -rnet/https -e "Net::HTTP.get URI('')"
net/http.rb:917:in `connect': SSL_connect returned=1 errno=0 state=SSLv3
  read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError)

You can work around the issue by installing a certificate bundle that you trust. I trust Mozilla and curl.

Blackjacx /
Last active May 9, 2019
My Apple Software Stack
jodosha / adapter_test.rb
Last active Aug 11, 2019
MiniTest shared examples
View adapter_test.rb
require 'test_helper'
shared_examples_for 'An Adapter' do
describe '#read' do
before do
@adapter.write(@key = 'whiskey', @value = "Jameson's")
it 'reads a given key' do

kvz: "I'm recommending these Mac apps to a colleague who's losing his OSX virginity: Anything you think I should add?"

Don't forget to look at the suggestions at the bottom, there's some cool stuff in there.


  • 1Password - password manager. intergrates with Dropbox & all main webbrowsers so you'll never lose a password again
  • Dropbox - a free 2GB folder in your homedir that stays in sync with all the devices you also install it on (linux/windows/mac/ipad/iphone/etc). Useful for backup, collaboration (share 1 folder with others), and keeping important documents with you.
  • Chrome - browsing
  • Colloquy - IRC
maxim /
Last active Feb 26, 2020
How to use rails load paths, app, and lib directories.

In Rails 3

NOTE: This post now lives (and kept up to date) on my blog:

If you add a dir directly under app/

Do nothing. All files in this dir are eager loaded in production and lazy loaded in development by default.

If you add a dir under app/something/

mike-zhang / udpProxy.go
Created Oct 8, 2012
Implementation of a UDP proxy in Golang
View udpProxy.go
// Implementation of a UDP proxy
package main
import (
brianhempel / bench_rails_memory_usage.rb
Last active Apr 5, 2020
A script to test the memory usage of your Rails application over time. It will run 30 requests against the specified action and report the final RSS. Choose the URL to hit on line 45 and then run with `ruby bench_rails_memory_usage.rb`.
View bench_rails_memory_usage.rb
require "net/http"
def start_server
# Remove the X to enable the parameters for tuning.
# These are the default values as of Ruby 2.2.0.
@child = spawn(<<-EOC.split.join(" "))
gcatlin / gist:1847248
Created Feb 16, 2012
Install specific version of Homebrew formula
View gist:1847248
brew update
brew versions FORMULA
cd `brew --prefix`
git checkout HASH Library/Formula/FORMULA.rb # use output of "brew versions"
brew install FORMULA
git checkout -- Library/Formula/FORMULA.rb # reset formula
## Example: Using Subversion 1.6.17
You can’t perform that action at this time.