Skip to content

Instantly share code, notes, and snippets.

View siers's full-sized avatar
:octocat:

Raitis Veinbahs siers

:octocat:
View GitHub Profile
@CrimsonRoselia
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 ~"
return
endif
if (getcwd() == '/')
echo "Won't run in /"
return
@creichert
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
border / Makefile
Created January 12, 2011 01:36
json example in golang
View Makefile
include $(GOROOT)/src/Make.inc
GOFMT=gofmt -spaces=true -tabindent=false -tabwidth=4
all:
$(GC) jsontest.go
$(LD) -o jsontest.out jsontest.$O
format:
$(GOFMT) -w jsontest.go
@cohei
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
int
main(int argc, char **argv)
{
intptr_t op[MAX + 2];
int ip;
@drasill
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')
endfunction
function! GitLsHandler(line)
execute 'e '. s:escape(a:line)
endfunction
command! -nargs=* Fgl call fzf#run({
\ 'source': 'git ls-files -o -c --exclude-standard "<args>"',
@nathanhammond
nathanhammond / Emscripten OS X.md
Created March 4, 2012 21:48
How to get Emscripten running on OS X.
View Emscripten OS X.md

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 raw.github.com/mxcl/homebrew/go)"
@emmanuelrosa
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 }:
let
fetchfont = name: num: sha:
fetchurl {
url = "https://fontsup.com/download/${builtins.toString num}.html";
sha256 = sha;
name = "${name}";
};
in stdenv.mkDerivation rec {
@codepr
codepr / Actor.scala
Last active May 5, 2021 21:10
Basic hello world cluster server
View Actor.scala
package clusterserver
import akka.actor._
class Logger extends Actor with ActorLogging {
log.info("Logger started!")
def receive = {
case msg => log.info("Got msg: {}", msg)
}