Skip to content

Instantly share code, notes, and snippets.

Marcin Kulik sickill

Block or report user

Report or block sickill

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
sickill / rw_ro_access.sql
Last active Oct 16, 2018 — forked from checco/rw_ro_access.sql
How to create a read only user in AWS RDS PostgreSQL and a user with superuser privileges on AWS RDS PostgreSQL
View rw_ro_access.sql
-- Read only
-- Create a group
CREATE ROLE ro_group;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO ro_group;
sickill /
Created Mar 6, 2018
Experiments with asciicast transformations
import sys
import asciinema.asciicast as asciicast
import as ev
# predicates
def _(actual):
return True
import sys
import os
import json
import asciinema.asciicast as asciicast
import asciinema.asciicast.frames as frames
# run me with:
# python3 original.cast edited.cast
sickill /
Last active Jul 26, 2019
Upload local recording to with curl
curl -v -u $USER:$(cat ~/.config/asciinema/install-id) -F asciicast=@/path/to/demo.cast
sickill / poolboy_demo.ex
Created May 8, 2017 — forked from henrik/poolboy_demo.ex
Example of using Poolboy in Elixir to limit concurrency (e.g. of HTTP requests).
View poolboy_demo.ex
defmodule HttpRequester do
use GenServer
def start_link(_) do
GenServer.start_link(__MODULE__, nil, [])
def fetch(server, url) do
# Don't use cast:
timeout_ms = 10_000
sickill / cleanup-input-stream.clj
Last active Mar 1, 2017
InputStream wrapper which calls given callback after the stream is closed.
View cleanup-input-stream.clj
(ns example
(defn cleanup-input-stream
"InputStream wrapper which calls given callback after
the stream is closed."
[is cleanup]
(proxy [FilterInputStream] [is]
(close []
(proxy-super close)
View streams.clj
(ns cheshire.experimental
(:require [cheshire.core :refer :all]
[ :refer :all])
(:import ( ByteArrayInputStream FilterInputStream
(defn escaping-input-stream
(let [new-is (proxy [FilterInputStream] [is]
sickill /
Last active Feb 8, 2017
Naive comparison of reduce/sum performance of Clojure 1.8, ClojureScipt (Planck 2.0, Lumo 1.1.0), Ruby 2.4, JRuby and Elixir 1.3.2

Naive micro-benchmark of reduce/sum I made to get the idea of raw performance range of different dynamic languages / different runtimes.

For each of these I repeated the execution until the timing stopped changing in major way (JIT etc), and saved only the last run.

Don't take it too seriously ;)

View asciinema-theme-monokai.css
/* Based on Monokai from base16 collection - */
.asciinema-theme-monokai .asciinema-terminal {
color: #f8f8f2;
background-color: #272822;
border-color: #272822;
.asciinema-theme-monokai .fg-bg {
color: #272822;
.asciinema-theme-monokai .bg-fg {
sickill / danny.datalog
Created Jan 26, 2017
"Find actors older than Danny Glover"
View danny.datalog
[:find ?actor
[?d :person/name "Danny Glover"]
[?d :person/born ?danny-age]
[?a :person/name ?actor]
[?a :person/born ?actor-age]
[?m :movie/cast ?a]
[(< ?actor-age ?danny-age)]]
You can’t perform that action at this time.