Skip to content

Instantly share code, notes, and snippets.

View siers's full-sized avatar

Raitis Veinbahs siers

View GitHub Profile
CrimsonRoselia / WeechatLogParser.hs
Last active February 14, 2018 13:27
Simple log parser for weechat in haskell, unfinished
View WeechatLogParser.hs
import Control.Applicative
import Data.Attoparsec.Text
import Data.Time
import Data.Text as T hiding (count, head)
import Data.Text.IO as TI (readFile)
import Data.Char (isSpace)
import System.Environment (getArgs)
data LogLine = LogLine LocalTime Text Text
View init.vim
let g:ctrlp_map = ''
function! CtrlP()
if (getcwd() == $HOME)
echo "Won't run in ~"
if (getcwd() == '/')
echo "Won't run in /"
creichert / fetch-url.hs
Last active January 9, 2020 19:39
Customize haskell http-client supported TLS ciphers
View fetch-url.hs
#!/usr/bin/env stack
-- stack -v runghc --package connection --package http-client --package http-client-tls --package tls --package data-default
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ViewPatterns #-}
{-# OPTIONS_GHC -fno-warn-deprecations #-}
import qualified Network.Connection as NC
import qualified Network.HTTP.Client as Http
import qualified Network.HTTP.Client.TLS as Http
import qualified Network.TLS as TLS
border / Makefile
Created January 12, 2011 01:36
json example in golang
View Makefile
include $(GOROOT)/src/
GOFMT=gofmt -spaces=true -tabindent=false -tabwidth=4
$(GC) jsontest.go
$(LD) -o jsontest.out jsontest.$O
$(GOFMT) -w jsontest.go
cohei / tap.hs
Last active June 25, 2020 16:32
Ruby's tap in Haskell
View tap.hs
import Data.Functor
tap :: Functor f => a -> (a -> f b) -> f a
x `tap` action = x <$ action x
-- Only standard output
-- >>> print 1
-- 1
-- Standard output and return value
View fizzbuzz_direct_threaded.c
#include <stdio.h>
#include <stdint.h>
#define MAX 100
main(int argc, char **argv)
intptr_t op[MAX + 2];
int ip;
drasill / vim-fzf-git-ls-files.vim
Created November 19, 2015 09:03
vim : git ls-file + fzf
View vim-fzf-git-ls-files.vim
function! s:escape(path)
return substitute(a:path, ' ', '\\ ', 'g')
function! GitLsHandler(line)
execute 'e '. s:escape(a:line)
command! -nargs=* Fgl call fzf#run({
\ 'source': 'git ls-files -o -c --exclude-standard "<args>"',
nathanhammond / Emscripten OS
Created March 4, 2012 21:48
How to get Emscripten running on OS X.
View Emscripten OS

Running emscripten on OS X

There are a number of additional dependencies required for getting things installed on OS X. Starting with a blank slate OS X machine, this is the process it takes:

# Install Xcode Command Line Tools

# Install Homebrew
ruby -e "$(curl -fsSkL"
emmanuelrosa / myriad-pro-font.nix
Last active September 10, 2020 16:48
Nix package for Myriad Pro font
View myriad-pro-font.nix
{ stdenv, fetchurl }:
fetchfont = name: num: sha:
fetchurl {
url = "${builtins.toString num}.html";
sha256 = sha;
name = "${name}";
in stdenv.mkDerivation rec {
codepr / Actor.scala
Last active May 5, 2021 21:10
Basic hello world cluster server
View Actor.scala
package clusterserver
class Logger extends Actor with ActorLogging {"Logger started!")
def receive = {
case msg =>"Got msg: {}", msg)