Instantly share code, notes, and snippets.

💭
¯\_(ツ)_/¯

# Marc Falzonfalzm

💭
¯\_(ツ)_/¯
• Sort options
Last active Aug 29, 2015
Some Clojure exercise
View aphyr_clojure_seq.clj
 ;;; Solutions to http://aphyr.com/posts/304-clojure-from-the-ground-up-sequences problems ; 1. Write a function to find out if a string is a palindrome–that is, if it looks the same forwards and backwards. (defn palindrome? "Find out if the string is a palindrome" [s] (= s (apply str (reverse s))))
Created May 23, 2014 — forked from XANi/collectd.clj
View collectd.clj
 ; Expire old events from the index every 5 seconds. (periodically-expire 600) (def graph (graphite {:host "127.0.0.1"})) ; Keep events in the index for 5 minutes by default. (let [index (default :ttl 300 (update-index (index)))] ; Inbound events will be passed to these streams: (streams
Created Jul 13, 2014
Testing standalone "_getPercentile()" Graphite function
View gist:259aa4a303ec63e77efc
 #!/usr/bin/env python # From https://github.com/graphite-project/graphite-web/blob/master/webapp/graphite/render/functions.py import math stats = [43.0, 54.0, 56.0, 61.0, 62.0, 66.0, 68.0, 69.0, 69.0, 70.0, 71.0, 72.0, 77.0, 78.0, 79.0, 85.0, 87.0, 88.0, 89.0, 93.0, 95.0, 96.0, 98.0, 99.0, 99.0]
Created Jul 13, 2014
Go percentile calculation implementation
View gist:52b3e66c149b9ba6fb58
 package main import ( "fmt" "math" "sort" ) var s = []float64{ 43.0, 54.0, 56.0, 61.0, 62.0, 66.0, 68.0, 69.0, 69.0, 70.0, 71.0,
Created Jul 13, 2014
Go percentile calculation implementation from go-metrics
View gist:b52c5ca32602e0779a2d
 // From https://github.com/rcrowley/go-metrics/blob/master/sample.go package main import ( "fmt" "math" "sort" )
Last active Aug 29, 2015
Quick'n dirty HTTP combined access log JSON formatter
View commonlog2json.go
 package main import ( "bufio" "fmt" "os" "regexp" ) func main() {
Last active Aug 29, 2015
Vim shortcut: move current line up/down
View gist:5865546c0e7d1ca425e0
 " Variation of https://coderwall.com/p/0cn9tq/move-lines-in-vim-like-phpstorm " + moves the current line up " + moves the current line down nnoremap ddkPk nnoremap ddpk
Last active Aug 29, 2015
Gory hack to download a GPG key from a keyserver in HTTP