Skip to content

Instantly share code, notes, and snippets.

2 2016-11-08
12 2016-11-10
2 2016-11-21
2 2016-11-23
20 2016-11-24
10 2016-11-28
7 2016-11-29
1 2017-01-03
20 2017-01-23
8 2017-02-07
#!/usr/bin/env bash
"exec" "clojure" "-Sdeps" "{:deps
{clj-http {:mvn/version \"3.9.1\"}
org.seleniumhq.selenium/htmlunit-driver {:mvn/version \"2.34.0\"}}}" "$0" "$@"
;; usage
;; update/install clojure: brew install clojure
;; make the file executable: chmod +x
;; fill in below config values
;; run the file whenever you want
for a in `heroku list -t omni | tail -n +2 | awk '{ print $1 }'`; do
count=`heroku ps -a $a --json | jq '[.[] | select(.type == "web")] | length' | tr -d '\n'`
if [ "$count" == "1" ]; then
heroku features:enable preboot -a $a
fi
done
@kubek2k
kubek2k / simple-binary-lambda-tutorial.md
Created December 1, 2018 22:50
Short tutorial on how to run any statically linked binary on lambda

Preamble

The introduction of Custom Runtimes has opened up new possibilities when it comes to the spectrum of languages that can be used in Amazon Lambda. This short document will show how to run virtually any statically linked binary on it. The example will cover a stack built Haskell project.

Preparations

@kubek2k
kubek2k / upload-custom-vcl-and-activate.sh
Last active August 30, 2018 12:46
Upload custom vcl to fastly and activate it after successful validation
set -e
function callFastly() {
endpoint="$1"
shift
curl -f -s -H "Fastly-Key: ${FASTLY_TOKEN}" -H "Accept: application/json" "https://api.fastly.com$endpoint" $*
}
function getCurrentVersion() {
callFastly "/service/$SERVICE_ID/version" | jq '.[0].number'
aws rds describe-db-instances | jq '.DBInstances[] | "" + .DBInstanceIdentifier + " " + .MasterUsername + " " + .Endpoint.Address' -r | grep pro > hosts
@kubek2k
kubek2k / process.xslt
Last active July 23, 2018 19:43
The XSLT template to deal with some weird data output from some accountants program.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:x="http://www.insert.com.pl/GTSchemas/ListaPlac.xsd"
xmlns:gttns="http://www.insert.com.pl/GTSchemas/Typy.xsd">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/">
<ListyPlac>
<xsl:apply-templates select="x:ListyPlac/x:ListaPlac" />
@kubek2k
kubek2k / stupid-payment-system.hs
Created July 8, 2018 21:16
Some XML parsing exercise for my dad
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Prelude hiding (readFile)
import Text.XML
import Text.XML.Cursor
import Text.XML.Cursor (node)
import qualified Data.Text as T
import qualified Data.Text.IO as TIO
import Data.Map ((!))

Notes from lecture of Kyle "aphyhr" Kingsbury

original talk

Initially he talked about the problems that he has found in multiple widely used DB's. Then he moved on to commercial products and described in detail what are those based on, and what kind of problems these can face.

CRANE.io

Keybase proof

I hereby claim:

  • I am kubek2k on github.
  • I am kubek2k (https://keybase.io/kubek2k) on keybase.
  • I have a public key ASBpjt6cJscJnRZAjsy9FlPtg2ZIjB6xBMUKjZJFPi2kPAo

To claim this, I am signing this object: