Skip to content

Instantly share code, notes, and snippets.

@sl4m
sl4m / Custom.less
Created October 5, 2012 00:24 — forked from bentruyman/Custom.less
Tomorrow Theme for Chrome Developer Tools
/**********************************************/
/*
/* Tomorrow Skin by Ben Truyman - 2012
/*
/* Based on Chris Kempson's Tomorrow Theme:
/* https://github.com/ChrisKempson/Tomorrow-Theme
/*
/* Inspired by Darcy Clarke's blog post:
/* http://darcyclarke.me/design/skin-your-chrome-inspector/
/*
@sl4m
sl4m / gist:1919670
Created February 26, 2012 23:28
man page section numbers
1. General commands
2. System calls
3. C library functions
4. Special files (usually devices, those found in /dev) and drivers
5. File formats and conventions
7. Miscellaneous
@sl4m
sl4m / gist:1617144
Created January 15, 2012 20:44
Create PublicKey object using public key generated from pre-Ruby 1.9.3 and SpongyCastle
import java.io.IOException;
import java.security.KeyFactory;
import java.security.NoSuchAlgorithmException;
import java.security.PublicKey;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.RSAPublicKeySpec;
import org.spongycastle.asn1.ASN1InputStream;
import org.spongycastle.asn1.DERObject;
import org.spongycastle.asn1.x509.RSAPublicKeyStructure;
@sl4m
sl4m / gist:1470360
Created December 13, 2011 03:18 — forked from emboss/gist:1470287
Encode pre-1.9.3 RSA public keys using X.509 format
require 'openssl'
require 'base64'
rsa = OpenSSL::PKey::RSA.new(2048)
modulus = rsa.n
exponent = rsa.e
oid = OpenSSL::ASN1::ObjectId.new("rsaEncryption")
alg_id = OpenSSL::ASN1::Sequence.new([oid, OpenSSL::ASN1::Null.new(nil)])
ary = [OpenSSL::ASN1::Integer.new(modulus), OpenSSL::ASN1::Integer.new(exponent)]
@sl4m
sl4m / 2011-09-29-why-you-dont-get-mock-objects.md
Created September 29, 2011 18:21 — forked from jasonrudolph/2011-09-29-why-you-dont-get-mock-objects.md
RubyConf 2011: Why You Don't Get Mock Objects

"Why You Don't Get Mock Objects" by Gregory Moeck

RubyConf 2011 | 2011-09-29 | Gregory Moeck (@gregmoeck)

  • Recommended as the best book on mocks: Growing Object-Oriented Software, Guided by Tests by Steve Freeman & Nat Pryce
  • Common arguments against mocks
    • They duplicate implementation
    • They lead to brittle tests
  • Mock objects + procedural programming = bad idea
  • If you're doing traditional Rails development (which tends to follow more of a "procedural", do-this-and-then-do-that style), mock objects probably aren't for you
@sl4m
sl4m / feynman_personal_observations_on_the_reliability_of_the_shuttle.markdown
Created August 22, 2011 14:23
Appendix F - Personal observations on the reliability of the Shuttle

Appendix F - Personal observations on the reliability of the Shuttle by R. P. Feynman

Introduction

It appears that there are enormous differences of opinion as to the probability of a failure with loss of vehicle and of human life. The estimates range from roughly 1 in 100 to 1 in 100,000. The higher figures come from the working engineers, and the very low figures from management. What are the causes and consequences of this lack of agreement? Since 1 part in 100,000 would imply that one could put a

@sl4m
sl4m / about.md
Last active December 11, 2015 15:38 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer
@sl4m
sl4m / .gvimrc
Created July 6, 2011 15:11
stealing janus' CommandTFlush call when FocusGained event is triggered
autocmd FocusGained * call s:CmdTFlush()
function s:CmdTFlush(...)
if exists(":CommandTFlush") == 2
CommandTFlush
endif
endfunction