Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am slawekkolodziej on github.
* I am slawekkolodziej (https://keybase.io/slawekkolodziej) on keybase.
* I have a public key ASDO5CThanMHVbHPZ82UHwKMZg-MSbvQfMoZc-qrJ4a0EQo
To claim this, I am signing this object:
@slawekkolodziej
slawekkolodziej / consul-agent.conf
Created May 30, 2016 14:34
Upstart config for consul-agent running on AWS ECS
# Upstart config for consul-agent running on
# ECS instance initiated with user-script: with https://gist.github.com/slawekkolodziej/3dbcd3a27b5949ab48e022ce68e3523d
description "Consul Agent Container"
author "Slawek Kolodziej"
start on stopped rc RUNLEVEL=[345]
respawn
script
/usr/bin/docker start -a consul-agent
end script
@slawekkolodziej
slawekkolodziej / user-data.sh
Created May 18, 2016 11:04
AWS user data script for setting up a consul cluster using all instances in a given ECS
#!/bin/bash -xe
S3_BUCKET=foo
EXPECTED_SERVERS=2
yum install -y aws-cli
aws s3 cp s3://$S3_BUCKET/ecs.config /etc/ecs/ecs.config
aws s3 cp s3://$S3_BUCKET/docker.config /etc/sysconfig/docker
run_consul_agent() {
peers=""
// ==UserScript==
// @name New ING Login Helper
// @description Creates a password input field for password managers
// @author Slawek Kolodziej
// @namespace slawekkolodziej
// @include https://login.ingbank.pl/mojeing/app/*
// @run-at document-end
// @version 1.2.0
// @grant none
// ==/UserScript==
setInterval(function() {
var time = ((countdownTimestamp * 1000) - new Date()) / 1000,
h = Math.floor(time / 60),
s = Math.floor(time % 60),
title = h + ":" + s;
document.getElementsByTagName("title")[0].textContent = title;
}, 1000);
@slawekkolodziej
slawekkolodziej / hackkrk.go
Last active December 16, 2015 15:19
hackkrk 4/2013 image upload
package main
import (
"encoding/json"
"fmt"
"image"
"image/color"
"image/draw"
"image/png"
"io/ioutil"
@slawekkolodziej
slawekkolodziej / reverse-flag-stacking.js
Created December 27, 2012 21:45
highcharts reverse flag stacking
(function (HC) {
var drawPoints = HC.seriesTypes.flags.prototype.drawPoints;
HC.seriesTypes.flags.prototype.drawPoints = function () {
drawPoints.call(this);
var points = this.points,
l, i;
for (i = 0, l = points.length; i < l; i++) {
@slawekkolodziej
slawekkolodziej / upcolor-fix.js
Created November 28, 2012 12:41
Fix bug with upColor in highcharts candlesticks
(function(HC){
var seriesTypes = Highcharts.seriesTypes;
seriesTypes.candlestick.prototype.getAttribs = function () {
seriesTypes.column.prototype.getAttribs.apply(this, arguments);
var series = this,
options = series.options,
stateOptions = options.states,
@slawekkolodziej
slawekkolodziej / connected-series.js
Created November 12, 2012 11:13
Connect multiple series visibility in Highcharts
Highcharts.Series.prototype.toggleConnected = function(visible) {
var visibility = visible || !this.visible,
series = this.options.connectedSeries,
l = series.length,
serie;
while (l--) {
serie = this.chart.get(series[l]);
serie.setVisible(visibility, false);
serie.checkbox && (serie.checkbox.checked = visibility);
@slawekkolodziej
slawekkolodziej / negative-column.js
Created August 21, 2012 15:51
color negative columns in Highstock
(function () {
var originalGetAttribs = Highcharts.seriesTypes.column.prototype.getAttribs;
Highcharts.seriesTypes.column.prototype.getAttribs = function () {
var merge = Highcharts.merge,
series = this,
points = series.points,
stateOptions = series.options.states,
negativeColor = series.options.negativeColor,