Skip to content

Instantly share code, notes, and snippets.

View szalansky's full-sized avatar
🎯
Focusing

szalansky

🎯
Focusing
View GitHub Profile
@szalansky
szalansky / latency.txt
Created May 31, 2012 14:26 — forked from jboner/latency.txt
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
Send 2K bytes over 1 Gbps network 20,000 ns
Read 1 MB sequentially from memory 250,000 ns
Round trip within same datacenter 500,000 ns
Disk seek 10,000,000 ns
@szalansky
szalansky / hash.rb
Created October 5, 2012 13:36 — forked from teamon/hash.rb
# Instead of:
# hash[:a].try(:[], :b).try(:[], :c).try(:[], :d)
# you can write
# hash[:a, :b, :c, :d]
class Hash
# h = {:a => {:b => {:c => 1}}}
# p h[:a] # => {:b => {:c => 1}}
# p h[:a, :b] # => {:c => 1}
# p h[:a, :b, :c] # => 1
class PeopleController < ApplicationController
before_filter :authenticate_user!, :except => [:index, :show]
...
end
*.aux
*.glo
*.idx
*.log
*.toc
*.ist
*.acn
*.acr
*.alg
*.bbl

Transparent Git Encryption

This document has been modified from its [original format][m1], which was written by Ning Shang (geek@cerias.net). It has been updated and reformatted into a [Markdown][m2] document by [Woody Gilk][m3] and [republished][m4].

Description

When working with a remote git repository which is hosted on a third-party storage server, data confidentiality sometimes becomes

Setting Up Clojure on OS X

I spent a lot of time trying to find a pretty optimal (for me) setup for Clojure… at the same time I was trying to dive in and learn it. This is never optimal; you shouldn't be fighting the environment while trying to learn something.

I feel like I went through a lot of pain searching Google, StackOverflow, blogs, and other sites for random tidbits of information and instructions.

This is a comprehensive "what I learned and what I ended up doing" that will hopefully be of use to others and act as a journal for myself if I ever have to do it again. I want to be very step-by-step and explain what's happening (and why) at each step.

Step 1: Getting Clojure (1.3)

Apple has changed how it distributes OS X Mavericks since its initial release in October 2013. This note was written on May 2, 2014. This affects the instructions you'll find online for how to make a bootable OS X installer.

It used to be that when you downloaded OS X from the App Store, the entire 5GB installer was placed in /Applications/Install OS X Mavericks.app. Now, there is a simple shortcut program placed in /Applications/OS X Mavericks.app. The app file is immediately removed in the event of an error or a successful post-install launch. When the download succeeds, the app file is launched which brings up the traditional install wizard, but this time mounted to /Volumes/Install OS X Mavericks.

I actually discovered this because if you already have a volume mounted of the same name (which I did, because I was trying to update my existing USB installer), the App Store download promptly fails right after finishing its download.

So if you have an empty disk you'd like to use as an installer that'

@szalansky
szalansky / show_jenkins_errors.bookmark
Last active August 29, 2015 14:26 — forked from christemple/show_jenkins_errors.bookmark
Bookmark: Show the errors in a Jenkins console output easier
javascript:var errors = jQuery('.console-output > span[style*="CD0000"]').clone(); jQuery('.console-output').empty(); jQuery('.console-output').append(errors); jQuery('.console-output > span').append("<br/>");
@szalansky
szalansky / disclaimer.txt
Created April 12, 2016 08:03 — forked from AJFaraday/disclaimer.txt
Email disclaimer
I am not now, nor have I ever been, bound in law
by conditions presented in the footer of communications
from parties with whom I have no verbal, implied, literal
or otherwise contract.
By opening this email you have agreed to provide Mr Andrew
Faraday with your organisations contact database, tangible
assets and outstanding shares free of charge and at your
personal expense.
@szalansky
szalansky / seeyouspacecowboy.sh
Created July 19, 2016 07:24
A shell script to display SEE YOU SPACE COWBOY whenever you logout of your terminal!
#!/usr/bin/env bash
# SEE YOU SPACE COWBOY by DANIEL REHN (danielrehn.com)
# Displays a timeless message in your terminal with cosmic color effects
# Usage: add "sh ~/seeyouspacecowboy.sh; sleep 2" to .bash_logout (or similar) in your home directory
# (adjust the sleep variable to display the message for more seconds)
# Cosmic color sequence