Skip to content

Instantly share code, notes, and snippets.

View lukaszkorecki's full-sized avatar
🌴
🛹

Łukasz Korecki lukaszkorecki

🌴
🛹
View GitHub Profile
@lukaszkorecki
lukaszkorecki / about.md
Created May 13, 2011 19:35
SCRABBLE CHEATER YO

so you wanna cheat in scrabbles?

ruby scrabble.rb REGEX

where REGEX can be something like

  • ^s.*z$ - will match all words starting with s and ending with z
  • .*lol$ - will match all word ending with lol
  • t...p - will match all words containing t, then any 3 letters and p
@lukaszkorecki
lukaszkorecki / commit.txt
Created July 2, 2010 13:24
Add your ASCII-art commit messages. For the greater good!
(\ /)
(O.o)
(> <) Bunny approves these changes.
// Hover.com "Zone file import/export" has been *Planned* since 2011
// https://help.hover.com/entries/471066-Zone-file-import-export
// Here's a brittle approximation of export.
//
// 1. login to your account: https://www.hover.com/domains
// 2. run the following in your browser's JavaScript console, changing the first line
// to your domain
// 3. copy the text logged to the console.
// 4. manually correct FQDNs, these have to end with a period "."
//
@lukaszkorecki
lukaszkorecki / intro.md
Created October 20, 2023 20:33
next.jdbc query debugging with Portal

Intro

Portal has a ton of useful formatters and because it leverages Hiccup, it's really easy to build on top of it. I wrote a tiny toolkit for debugging:

  • queries generated by HoneySQL
  • dealing with invalid query exceptions thrown by Postgres

For small queries it's easy to figure out where the error is, but with multiple CTEs, conditionally building parts of the query, things get messy.

@lukaszkorecki
lukaszkorecki / Dockerfile
Created February 17, 2021 17:04
AWS Lambda + babashka + minimal container image
FROM alpine:3.11.3
RUN apk update && apk add curl ca-certificates unzip && rm -rf /var/cache/apk/*
RUN curl -L 'https://github.com/babashka/babashka/releases/download/v0.2.10/babashka-0.2.10-linux-static-amd64.zip' -o /tmp/bb.zip && \
unzip /tmp/bb.zip && \
mv bb /usr/bin/bb && \
chmod +x /usr/bin/bb
RUN mkdir -p /app
@lukaszkorecki
lukaszkorecki / move.mkd
Created May 7, 2011 23:31
Download manga from MangaReader.net
ORIGINAL_JENKINS_SERVER=
ORIGINAL_SERVER_USER=
NEW_JENKINS_SERVER=
NEW_SERVER_USER=
# ON THE ORIGINAL JENKINS SERVER
ssh $ORIGINAL_SERVER_USER@$ORIGINAL_JENKINS_SERVER
cd /var/lib/jenkins/
for i in `ls jobs`; do echo "jobs/$i/config.xml";done > config.totar
#!/usr/bin/env bash
set -oe pipefail
jarPath=$1
# inspired by metabase
# Disable limit to amount of time spent in GC. Better slow than not working at all
JAVA_OPTS="$JAVA_OPTS -XX:-UseGCOverheadLimit"
JAVA_OPTS="$JAVA_OPTS -XX:+UseConcMarkSweepGC"
.ONESHELL:
test: .SHELLFLAGS := -i
test: SHELL := bb
test:
(println :wow)
(require '[clojure.string :as s])
(s/reverse (slurp "./Makefile"))
# - ubuntu : cd tmp/graleph/
# master - graleph : make run
docker run --net host --rm -it graleph:latest
date=2020-06-12 00:22:16,451 level=INFO thread=main ns=graleph.core message=starting
date=2020-06-12 00:22:16,523 level=INFO thread=clojure-agent-send-off-pool-0 ns=graleph.core message=[]
Exception in thread "main" java.lang.IllegalArgumentException: Class NioDatagramChannel does not have a public non-arg constructor
at io.netty.channel.ReflectiveChannelFactory.<init>(ReflectiveChannelFactory.java:36)
at io.netty.bootstrap.AbstractBootstrap.channel(AbstractBootstrap.java:110)
at aleph.udp$socket.invokeStatic(udp.clj:51)
at graleph.core$start.invokeStatic(core.clj:21)