Skip to content

Instantly share code, notes, and snippets.

View siers's full-sized avatar
:octocat:

Raitis Veinbahs siers

:octocat:
View GitHub Profile
@border
border / Makefile
Created January 12, 2011 01:36
json example in golang
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
@nicerobot
nicerobot / chrome-cookies.sh
Created December 7, 2011 16:59
Convert Google Chrome sqlite Cookies into cookies.txt. Useful for utilities like curl.
sqlite3 -separator ' ' ${COOKIES:-Cookies} \
'select host_key, "TRUE", path, "FALSE", expires_utc, name, value from cookies'
@nathanhammond
nathanhammond / Emscripten OS X.md
Created March 4, 2012 21:48
How to get Emscripten running on OS X.

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)"
@CrimsonRoselia
CrimsonRoselia / WeechatLogParser.hs
Last active February 14, 2018 13:27
Simple log parser for weechat in haskell, unfinished
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
bind-key C-b send-prefix
bind-key C-o rotate-window
bind-key C-z suspend-client
bind-key Space next-layout
bind-key ! break-pane
bind-key " split-window
bind-key # list-buffers
bind-key $ command-prompt -I #S "rename-session '%%'"
bind-key % split-window -h
bind-key & confirm-before -p "kill-window #W? (y/n)" kill-window
@cohei
cohei / tap.hs
Last active June 25, 2020 16:32
Ruby's tap in Haskell
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
@travisbhartwell
travisbhartwell / nix-shell-shebang.md
Last active March 13, 2024 13:54
nix-shell and Shebang Lines

NOTE: a more up-to-date version of this can be found on my blog

nix-shell and Shebang Lines

A few days ago, version 1.9 of the Nix package manager was released. From the release notes:

nix-shell can now be used as a #!-interpreter. This allows you to write scripts that dynamically fetch their own dependencies.

@drasill
drasill / vim-fzf-git-ls-files.vim
Created November 19, 2015 09:03
vim : git ls-file + fzf
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>"',
@jfmengels
jfmengels / lodash-fp-documentation.md
Last active February 6, 2024 20:57
Generated docs for Lodash/fp. Help make them better at https://github.com/jfmengels/lodash-fp-docs
@codepr
codepr / Actor.scala
Last active May 5, 2021 21:10
Basic hello world cluster server
package clusterserver
import akka.actor._
class Logger extends Actor with ActorLogging {
log.info("Logger started!")
def receive = {
case msg => log.info("Got msg: {}", msg)
}