Skip to content

Instantly share code, notes, and snippets.

View sl4m's full-sized avatar
😎
😎

skim sl4m

😎
😎
View GitHub Profile
// from http://www.conwaysgameoflife.net/
function conwaysgameoflife() {
var M = '',
nb = '" for "gwt:onLoadErrorFn"',
lb = '" for "gwt:onPropertyErrorFn"',
Y = '"><\/script>',
$ = '#',
Lb = '.cache.html',
ab = '/',
(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))
/**
move positions
0 | 1 | 2
---+---+---
3 | 4 | 5
---+---+---
6 | 7 | 8
*/
# move positions
#
# 0 | 1 | 2
# ---+---+---
# 3 | 4 | 5
# ---+---+---
# 6 | 7 | 8
class TicTacToe
module Patterns
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
## basic workflow
* edit files
* stage the changes
* review your changes
* commit the changes
## basic[er] workflow
* edit files
rubyquiz.com
projecteuler.net
gogaruco.com
edgecase.com
pragmaticstudio.com
web
Rails, PHP, Python, Java, .NET
rails host
# shared hosting
* HostGator
* HostingRails
Ruby VMs
YARV
Rubinius
JRuby
IronRuby
MacRuby
First, I would like to start out by recommending that anyone who is
serious about software craftsmanship go out and read Pete McBreen's
book "Software Craftsmanship". I think it's a critical starting place
for these discussions, and on a more personal note, the book had a
huge impact on me. Probably the biggest reason I am a part of this
group is that I have no where else to go. :) I was a later-in-life
self-taught programmer who had a wife and child(ren) to support from
the day I wrote my first for loop, so I have no formal scientific or
engineering education, and I don't have the option of taking time off
to obtain one. And yet I want to become great at what I do. In my