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
@tomekbielaszewski
tomekbielaszewski / example.sql
Created July 30, 2019 11:43
PostgreSQL: Removing nested JSON property
-- before:
-- my_json = {some_var: 10, some_nested_ob: {some_var: 10, another_var: 20}}
-- after:
-- my_json = {some_var: 10, some_nested_ob: {another_var: 20}}
WITH subquery AS (
SELECT my_json #- '{some_nested_ob,some_var}' AS updated_json,
id
FROM my_table
WHERE (my_json -> 'some_nested_ob') -> 'some_var' IS NOT NULL
@tomekbielaszewski
tomekbielaszewski / main.go
Last active August 17, 2023 19:22
Example of RabbitMQ reconnect feature. Including recovering already registered consumers.
package main
import (
"fmt"
"log"
"time"
)
func main() {
queue := NewQueue("amqp://guest:guest@localhost:5672/", "hello")
# 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