Skip to content

Instantly share code, notes, and snippets.

View sl4m's full-sized avatar
😎
😎

skim sl4m

😎
😎
View GitHub Profile
SpiderMonkey, implementation in C, ECMA-262 Edition 3 (Gecko)
Rhino, implementation in Java, ECMA-262 Edition 3 (none)
Nitro aka SquirrelFish (WebKit)
V8 (WebKit)
TraceMonkey (FF)
JagerMonkey (FF, Nitro/TraceMonkey cross child)
Futhark
Carakan (Presto)
Chakra (IE)
// need to mess with document.defaultAction = true/false to block default action;
// idea from http://www.quirksmode.org/js/keys.html
window.onload = function () {
var keyCodeUp,
keyCodeDown,
currentIndex,
fonts,
currentFont,
setGlobalFont,
MySQL commands (from http://www.pantz.org/software/mysql/mysqlcommands.html)
Create a database on the sql server.
mysql> create database [databasename];
List all databases on the sql server.
mysql> show databases;
Switch to a database.
mysql> use [db name];
def tip(msg); puts; puts msg; puts "-"*100; end
#
# 30 Ruby 1.9 Tips, Tricks & Features:
# http://www.igvita.com/2011/02/03/new-ruby-19-features-tips-tricks/
#
tip "Upgrading to Ruby 1.9 is simple: rvm install 1.9.2 && rvm --default 1.9.2"
tip "Ruby 1.9 supports named captures in regular expressions!"
@sl4m
sl4m / excellent_executable_requirements.markdown
Created February 9, 2011 03:28
Excellent Executable Requirements

Presenters

@ericlandes @dan_sb

Agile and Beyond Conference (dry-run)

What bad looks like

  • lengthy
@sl4m
sl4m / gist:1013772
Created June 8, 2011 04:31
gst class hierarchy
Object
Behavior
ClassDescription
Class
Metaclass
BlockClosure
Boolean
False
True
Browser
@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
@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 / 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 / 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