Skip to content

Instantly share code, notes, and snippets.

Working from home

Yrjö Kari-Koskinen ykarikos

Working from home
  • Tomorrow Tech
  • Helsinki
View GitHub Profile
View hwoteams.js
// Install:
// npm install lodash request cheerio
// Usage:
// nodejs hwoteams.js
var request = require('request')
, cheerio = require('cheerio');
var fs = require('fs');
var _ = require('lodash');
ykarikos / gist:0a4c13e6e349e2270b86
Last active Aug 29, 2015
convert bunch of avi files to mp4 for ipad with ffmpeg
View gist:0a4c13e6e349e2270b86
for f in *.avi; do file=`basename "$f" .avi`; ffmpeg -i "$f" -acodec libfaac -ab 160000 -vcodec libx264 -b 1200k -threads 0 -f mp4 "$file.mp4"; done
ykarikos / gist:25ebbb38e910c691a52d
Created Sep 26, 2014
Reaktor dev day Monads workshop exercise
View gist:25ebbb38e910c691a52d
-- #!/usr/bin/env runhaskell
import Control.Applicative
import Control.Monad
plus3 x = x + 3
data List a = Nil | Cons a (List a)
deriving (Show)
instance Functor List where
ykarikos /
Created Oct 28, 2014
Transform Tech radar questionnaire input into svg
import sys
from math import sin, cos
prefix = """<svg width="800" height="800" xmlns="" >
<g transform="translate(400,400)">
<circle r="350" style="fill: rgb(190, 195, 230);"></circle>
<g transform="translate(400,400)">
ykarikos / get-timezone-delta.clj
Created Dec 10, 2014
Calculate timezone difference between two dates
View get-timezone-delta.clj
(defn get-timezone-delta [dateformat utc-time-string local-time-string]
(let [utc-time (f/parse dateformat utc-time-string)
local-time (f/parse dateformat local-time-string)
abs-delta (t/in-hours (t/interval (t/earliest utc-time local-time) (t/latest utc-time local-time)))]
(if (t/after? utc-time local-time)
(- abs-delta)
#!/bin/sh -e
BACKUP_FILE="$HOST-`date -I`.tar.bz2.gpg"
MYSQL_FILE="mysql-`date -I`.bak.gpg"
ykarikos / client repl.clj
Last active Aug 29, 2015
Full duplex Websocket connections with manifold streams and aleph http lib
View client repl.clj
user=> (use 'ws-test)
user=> @state
user=> (connect "localhost")
user=> @@connection
<< stream: {:type "splice", :sink {:type "netty", :sink? true, :closed? false}, :source {:pending-puts 0, :drained? false, :buffer-size 0, :permanent? false, :type "manifold", :sink? true, :closed? false, :pending-takes 1, :buffer-capacity 16, :source? true}} >>
user=> (send-message @@connection {:msg "It works!" :count 1})
<< true >>
ykarikos / gist:f1e6e208789e300f7adc
Created May 30, 2015
Talvikin numeroharjoittelu
View gist:f1e6e208789e300f7adc
(use '[ :only [sh]])
(defn say [& args] (apply sh "say" args))
(defn say-and-print [n]
(let [n-str (str n)]
(println n-str)
(Thread/sleep 2000)
(say n-str)))

Keybase proof

I hereby claim:

  • I am ykarikos on github.
  • I am ykk ( on keybase.
  • I have a public key whose fingerprint is 2E71 56C3 7760 E735 B175 E053 0E4E A201 3B3A BE42

To claim this, I am signing this object:

ykarikos / gist:0d5cfa0d0ee467808810
Created Sep 17, 2015
Check that NS record match in all zone name servers
View gist:0d5cfa0d0ee467808810;; dig +short -t NS $DOMAIN @$MASTER |sort >/tmp/$MASTER; for h in `cat /tmp/$MASTER`; do echo - Querying $h:; dig +short -t NS $DOMAIN @$h |sort |diff /tmp/$MASTER -; done