Skip to content

Instantly share code, notes, and snippets.

View tomekbielaszewski's full-sized avatar
😎
Chillin' & Codin'

Tomek Bielaszewski tomekbielaszewski

😎
Chillin' & Codin'
View GitHub Profile
@mcpower
mcpower / aoc-tips.md
Last active March 27, 2024 03:28
Tips for getting on the Advent of Code leaderboard

Hi, I'm mcpower. I've done Advent of Code seriously for two years now in Python, placing 9th in 2018 and 12th in 2017. This year, I'm taking a break from aiming for the leaderboard - while it's fun and all, it is a bit stressful at times (the good kind of stress, though!). As such, I'd like to share a few tips for anyone wanting to aim for the leaderboard.

This is everything that worked for me. Your mileage may vary, though - don't take this as gospel, see what works for you.

Go fast

Go fast.

# wget -i this_file
http://www.oreilly.com/programming/free/files/files/microservices-for-java-developers.pdf
http://www.oreilly.com/programming/free/files/modern-java-ee-design-patterns.pdf
http://www.oreilly.com/programming/free/files/object-oriented-vs-functional-programming.pdf
http://www.oreilly.com/programming/free/files/java-the-legend.pdf
http://www.oreilly.com/programming/free/files/functional-programming-python.pdf
http://www.oreilly.com/programming/free/files/reactive-microservices-architecture-orm.pdf
http://www.oreilly.com/programming/free/files/migrating-cloud-native-application-architectures.pdf
http://www.oreilly.com/programming/free/files/software-architecture-patterns.pdf
@dlsniper
dlsniper / cross-compile-go.bash
Created October 13, 2017 21:45
Cross compile Go for Raspberry Pi 3
cd ~
git clone git@github.com:golang/go.git gotip
cd gotip/src
export GOROOT_BOOTSTRAP=/usr/local/go
env GOOS=linux GOARCH=arm GOARM=7 ./make.bash
@LukaszWiktor
LukaszWiktor / postgres-remove-field-from-json.sql
Created November 25, 2016 16:20
PostrgreSQL - remove a nested JSON field if it's null
-- before: data_json = {object: {id: 123, result: null}}
-- after: data_json = {object: {id: 123}}
UPDATE events
SET data_json = data_json::jsonb #- '{object,result}'
WHERE json_typeof(data_json->'object'->'result') = 'null';

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@subfuzion
subfuzion / curl.md
Last active May 3, 2024 09:26
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@hfreire
hfreire / qemu_osx_rpi_raspbian_jessie.sh
Last active March 24, 2024 14:35
How to emulate a Raspberry Pi (Raspbian Jessie) on Mac OSX (El Capitan)
# Install QEMU OSX port with ARM support
sudo port install qemu +target_arm
export QEMU=$(which qemu-system-arm)
# Dowload kernel and export location
curl -OL \
https://github.com/dhruvvyas90/qemu-rpi-kernel/blob/master/kernel-qemu-4.1.7-jessie
export RPI_KERNEL=./kernel-qemu-4.1.7-jessie
# Download filesystem and export location
@xkr47
xkr47 / letsencrypt-jetty.sh
Last active August 29, 2023 07:22
How to use Letsencrypt certificate & private key with Jetty
# input: fullchain.pem and privkey.pem as generated by the "letsencrypt-auto" script when run with
# the "auth" aka "certonly" subcommand
# convert certificate chain + private key to the PKCS#12 file format
openssl pkcs12 -export -out keystore.pkcs12 -in fullchain.pem -inkey privkey.pem
# convert PKCS#12 file into Java keystore format
keytool -importkeystore -srckeystore keystore.pkcs12 -srcstoretype PKCS12 -destkeystore keystore.jks
# don't need the PKCS#12 file anymore
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active May 3, 2024 16:53
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'