Skip to content

Instantly share code, notes, and snippets.

View lwiechec's full-sized avatar

Lukasz Wiechec lwiechec

  • Den Haag, Nederland
View GitHub Profile
@lwiechec
lwiechec / oidc_client.clj
Created January 31, 2024 09:43 — forked from holyjak/oidc_client.clj
A stateful CLI tool for getting access token from an OIDC provider
#!/usr/bin/env bb
(ns oidc-client
"Get end-user access token from an OIDC provider, caching the access/refresh token in an encrypted file. Code in https://babashka.org
Usage:
/path/to/oidc_client.clj
When there are no cached, valid tokens, it will open a browser with the OIDC provider login URL and start a HTTPS-enabled
callback server on localhost. Make sure that the resulting redirect_uri is registered with your provider.
@lwiechec
lwiechec / System Design.md
Created April 26, 2016 21:26 — forked from vasanthk/System Design.md
System Design Cheatsheet

#System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

##Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@lwiechec
lwiechec / Gen.java
Created April 16, 2016 16:30 — forked from kbsriram/Gen.java
simple emacs tags generator for java source - only indexes classes and interfaces.
import java.io.BufferedOutputStream;
import java.io.ByteArrayOutputStream;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.File;
import java.io.Reader;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.StreamTokenizer;
/**
* Class that throttles requests. Ensures that the StartRequest cannot be called
* more than a given amount of time in any given interval.
*
* StartRequest blocks until this requirement is satisfied.
*
* TryStartRequest returns 0 if the request was cleared, or a non-0 number of
* millisecond to sleep before the next attempt.
*
* Simple usage, 10 requests per second:
@lwiechec
lwiechec / maven-deps.awk
Created August 24, 2012 13:28 — forked from fs111/gist:3097209
nexus commandline search
#!/bin/bash
# command line search script for nexus instances. Needs curl and xmlstarlet
# installed.
NEXUS_URL="http://nexus.example.com/nexus/service/local/lucene/search?q="
# make sure we got exactly one param
if [ ! $# -eq 1 ]
then