Skip to content

Instantly share code, notes, and snippets.

View edvardm's full-sized avatar

Edvard Majakari edvardm

  • Rakettitiede Oy
  • Finland
  • 07:01 (UTC +03:00)
View GitHub Profile
@wojteklu
wojteklu / clean_code.md
Last active April 15, 2024 20:31
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@shangaslammi
shangaslammi / hello-ski.hs
Created August 23, 2012 16:53
Hello World using SKI combinator calculus
s x y z = x z (y z)
k x y = x
i = s k k
c = s (s (k (s (k s) k)) s) (k k)
b = s (k s) k
hello =
s(s(k s)(s(k k)(s(k s)(s(k(s(k s)))(s(s(k s)(s(k k)(s(k b)i)))(k(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s
b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(c k))))))))))))))))))))))))))))))))))))))))))
)))))))))))))))))))))))))))(s(s(k s)(s(k k)(s(k s)(s(k(s(k s)))(s(s(k s)(s(k k)(s(k b)i)))(k(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s
@shangaslammi
shangaslammi / nfa.hs
Created November 18, 2011 15:43
A simple NFA in Haskell
-- See: http://swizec.com/blog/strangest-line-of-python-you-have-ever-seen/swizec/3012
import Control.Monad
import Data.Maybe
import System.Environment
data NFA s i = NFA s [s] [((s,i),[s])]
runNFA (NFA i f t) = any (`elem` f) . foldM step i where
step s c = fromMaybe [] $ lookup (s,c) t