Skip to content

Instantly share code, notes, and snippets.

View bneijt's full-sized avatar

Bram Neijt bneijt

View GitHub Profile
@bneijt
bneijt / titanic.ipynb
Last active March 16, 2017 10:32
Second time boom, titanic fails
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bneijt
bneijt / release.py
Created September 16, 2016 09:44
Simple git java maven project release script: remove SNAPSHOT, test build, generate random tag, commit, introduce SNAPSHOT again
#!/usr/bin/python2
import sys
import pygit2 as git
import os
import re
import logging
import xml.etree.ElementTree as ET
import optparse
import subprocess
@bneijt
bneijt / gist:9bdb4b1759790a8463c9
Last active May 8, 2017 23:32
Create json files form simple first-line image, rest description files
#!/usr/bin/runghc
{-# LANGUAGE NoImplicitPrelude, OverloadedStrings #-}
import Prelude (Show, IO, (++), print, String, filter)
import Data.List (isSuffixOf)
import Data.Text hiding (isSuffixOf, filter)
import Data.Text.IO
import Control.Monad (mapM_)
import qualified Data.ByteString.Lazy as BL
import System.Directory (getDirectoryContents)
-module(something).
-export([a/0, b/0, c/0]).
a() -> erlang:display("a").
b() -> a.
c() -> fun a/0.
lists:map(fun(X) -> erlang:display(X) end, ["hello"]).
lists:map(erlang:display, ["hello"]).
%Wrong, you can not refer to erlang:display that way. Would you be pointing to erlang:display/1 or erlang:display/2 ??
lists:map(erlang:display/1, ["hello"]).
%Illegal expression, erlang:display/1 is more like splitting an atom in 1 then it is referring to a function
lists:map(fun erlang:display/1, ["hello"]).
%Yes, this will work. I'm now referring to the function display/1 in the erlang module... few.
[erlang:display(X) || X <- ["hello"]].
%Also works, list expressions.
@bneijt
bneijt / gist:648855
Created October 27, 2010 11:15
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 10.10
Release: 10.10
Codename: maverick
@bneijt
bneijt / gist:648854
Created October 27, 2010 11:14
$ cat /proc/$$/limits
Limit Soft Limit Hard Limit Units
Max cpu time unlimited unlimited seconds
Max file size unlimited unlimited bytes
Max data size unlimited unlimited bytes
Max stack size 8388608 unlimited bytes
Max core file size 0 unlimited bytes
Max resident set unlimited unlimited bytes
Max processes unlimited unlimited processes
Max open files 1024 1024 files
Max locked memory 65536 65536 bytes