Skip to content

Instantly share code, notes, and snippets.

@wolftatsu
wolftatsu / gist:7194388
Last active December 26, 2015 18:29
My Python Utilities
# -*- coding: utf-8 -*-
import yaml,re
import logging
import logging.handlers
import traceback
import random
import datetime
import time
try:
@wolftatsu
wolftatsu / gist:5744286
Last active December 18, 2015 07:09
Factorial on Clojure
;; 1
(defn factorial [n]
(loop [ret 1 x n]
(if (zero? x)
ret
(recur (* ret x) (dec x)))))
;; 2
(defn factorial2 [n]
(reduce * (range 1 (+ n 1))))