Skip to content

Instantly share code, notes, and snippets.

View sl4m's full-sized avatar
😎
😎

skim sl4m

😎
😎
View GitHub Profile
## basic workflow
* edit files
* stage the changes
* review your changes
* commit the changes
## basic[er] workflow
* edit files
SOLID =>
Single Responsibility Principle (SRP) => object should only have single responsiblity
Open/Closed Principle (OCP) => should be open for extension , but closed for modification
Liskov Substitution Principle (LSP) => design by contract
Interface Segregation Principle (ISP) => many client interfaces are better than one general purpose interface
Dependency Injection Principle (DIP) => one should 'depend upon abstractions, not depend upon concretions'
http://en.wikipedia.org/wiki/Solid_%28Object_Oriented_Design%29
Code smell - http://en.wikipedia.org/wiki/Code_smell
# move positions
#
# 0 | 1 | 2
# ---+---+---
# 3 | 4 | 5
# ---+---+---
# 6 | 7 | 8
class TicTacToe
module Patterns
/**
move positions
0 | 1 | 2
---+---+---
3 | 4 | 5
---+---+---
6 | 7 | 8
*/
(ns sieve
(:use clojure.test))
(defn square [x] (* x x))
(defn seq-contains? [ls x]
(boolean (some #(= x %) ls)))
(defn multiple-of? [product divisor]
(and (= 0 (mod product divisor))
// from http://www.conwaysgameoflife.net/
function conwaysgameoflife() {
var M = '',
nb = '" for "gwt:onLoadErrorFn"',
lb = '" for "gwt:onPropertyErrorFn"',
Y = '"><\/script>',
$ = '#',
Lb = '.cache.html',
ab = '/',
var sys,
url,
querystring,
http,
searchUser,
listRepos,
postHandler;
sys = require('sys');
url = require('url');
querystring = require('querystring');
Sauder, Maloof, O'Sullivan, and Stickley. Four names that have one thing in common: furniture. Two of these build cheap knock-together furniture that can be found at IKEA or any office furniture store, the other two build one-of-a-kind instant classics. Sauder and O'Sullivan are companies that make pre-cut pieces of composite wood and veneer using CNC machines, and package them with a hardware kit and assembly instructions. Sam Maloof and Gustav Stickley were furniture craftsmen. Both have passed on, but their legacy of impeccable craftsmanship remains, and demand for their work only increases with time.
The two companies mass-produce identical copies of economical furniture for sale in large retail stores, where customers can purchase them cheaply. The relative quality of the products is reflected in their prices and availability. While both companies make a serviceable product at a reasonable price, it's likely people buy it for its convenience and availability and price, not its fine craft
@sl4m
sl4m / mice.css
Created September 10, 2010 16:16 — forked from jeffkreeftmeijer/mice.css
.mouse, #preview{
position: absolute;
background-repeat: no-repeat;
height: 22px;
min-width: 15px;
z-index: 100;
}
.mouse{
background-image: url('../images/cursor.png');
@sl4m
sl4m / gist:712272
Created November 23, 2010 18:45
smalltalk_reference.st
"Chris Rathman / [email protected]
************************************************************************
* Allowable characters: *
* - a-z *
* - A-Z *
* - 0-9 *
* - .+/\*~<>@%|&? *
* - blank, tab, cr, ff, lf *
* *
* Variables: *