Skip to content

Instantly share code, notes, and snippets.

indul a gorog aludni
)]:-O :-C :~# :-7
:-O
:-( [:]o< 8=\ 8-E :-)
[:]oO
:-( [:]oQ 8=\ 8-E :-)
@zsol
zsol / output
Created September 19, 2015 14:55
Oncall schedule calculator
Components and number of owners:
{u'c2': 2,
u'c3': 4,
u'c4': 2,
u'c5': 2,
u'component1': 3}
--------------------------------
Possible minimal oncall rotations:
[set([u'charlie',
u'dave']),
diff --git a/icinga-app/icinga.cpp b/icinga-app/icinga.cpp
index 8ecfe56..4ec014f 100644
--- a/icinga-app/icinga.cpp
+++ b/icinga-app/icinga.cpp
@@ -210,8 +210,8 @@ static bool SetDaemonIO(const String& stderrFile)
if (fdnull != 0)
dup2(fdnull, 0);
- if (fdnull != 1)
- dup2(fdnull, 1);

Keybase proof

I hereby claim:

  • I am zsol on github.
  • I am zsol (https://keybase.io/zsol) on keybase.
  • I have a public key whose fingerprint is 21EE A6A4 EF06 1CB2 0082 F208 0EA6 EB87 C124 0D6F

To claim this, I am signing this object:

@zsol
zsol / install_haskell_platform.sh
Created January 15, 2014 13:26
Install haskell platform on mavericks
#!/bin/bash
set -e
tmp=$(mktemp -d)
trap "rm -rf $tmp" EXIT
cd $tmp
curl -O http://www.haskell.org/platform/download/2013.2.0.0/Haskell%20Platform%202013.2.0.0%2064bit.pkg
@zsol
zsol / Card.hs
Created September 20, 2013 13:12
credit card validation
module Card where
import Data.Char
produceDigits :: Integer -> [Int]
produceDigits n = [(ord i) - 48| i <- (show n)]
doubleEveryOther :: [Int] -> [Int]
doubleEveryOther l = case (length l) `mod` 2 of
0 -> helper0 l
@zsol
zsol / blurb.md
Last active December 23, 2015 09:19
Budapest New Tech Meetup Haskell blurb

Why Haskell Matters to You

Why are we at Prezi pushing Haskell adoption internally? Why bother having the fourth production application written in a lazy, statically typed, purely functional language? What are the good parts and more interestingly, what have been the painful points so far? Be prepared for some production code examples.

Prezi.com

Prezi is a virtual whiteboard that transforms presentations from monologues into conversations: enabling people to see, understand, and remember ideas. I'm Zsolt, a tech lead at Prezi: https://prezi.com/about/zsolt-dollenstein/

@zsol
zsol / Abesto.hs
Last active December 22, 2015 13:29
Generating function to parse plain data constructors without arguments. Useful for @abesto and the SDL types
{-# LANGUAGE TemplateHaskell #-}
module Abesto(mkRead) where
import Language.Haskell.TH
import Data.Maybe
constructors :: Info -> Maybe [Name]
constructors (TyConI (DataD _cxt _name _bnds cons _names)) = Just $ catMaybes $ map getName cons
where getName (NormalC name _types) = Just name
@zsol
zsol / fcat.hs
Last active December 21, 2015 13:28
{-# LANGUAGE OverloadedStrings #-}
import qualified Data.Text as T
import qualified Data.Text.IO as T
import Data.Time
import System.Exit
import System.IO.Error
import System.Locale
format :: String
format = "%Y-%m-%d %H:%M:%S,%q"
@zsol
zsol / Memo.hs
Created February 14, 2013 08:20
{-
you need the memoize cabal package to use this.
http://hackage.haskell.org/package/memoize-0.3
-}
import System.IO.Unsafe
import System.Posix.Files
import System.Posix.Types
import Data.Function.Memoize
import Debug.Trace