Skip to content

Instantly share code, notes, and snippets.

_/﹋\_
(҂`_´)
<,︻╦╤─ ҉ - - Y O U G O T H A C K E D
_/﹋\_
{
"public_identifier": "eden-marco",
"profile_pic_url": "https://s3.us-west-000.backblazeb2.com/proxycurl/person/eden-marco/profile?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=0004d7f56a0400b0000000001%2F20240609%2Fus-west-000%2Fs3%2Faws4_request&X-Amz-Date=20240609T145729Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=2773956fb88e429ba25214cd60a8fd40c0b6c26e3dc606a2b61dc4aea384b8b5",
"background_cover_image_url": "https://s3.us-west-000.backblazeb2.com/proxycurl/person/eden-marco/cover?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=0004d7f56a0400b0000000001%2F20240609%2Fus-west-000%2Fs3%2Faws4_request&X-Amz-Date=20240609T145729Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=cc9166ff7356a3805f758246a1b989a0229c7eddd9d207a9d573a7c686fc8427",
"first_name": "Eden",
"last_name": "Marco",
"full_name": "Eden Marco",
"follower_count": 4414,
"occupation": "LLM Specialist, Customer Engineering - Google Cloud at Google",
"headline": "LLMs @ Google
@vingao
vingao / redisviewer.py
Created March 16, 2023 01:48 — forked from tito/redisviewer.py
Redis pubsub viewer
import redis
import sys
host = sys.argv[1]
room = sys.argv[2]
print "-- connect to redis"
client = redis.Redis(host=host)
pubsub = client.pubsub()
pubsub.subscribe(room)
print "-- listen to {}".format(room)
@vingao
vingao / RAILS_CHEATSHEET.md
Created July 10, 2022 04:16 — forked from mdang/RAILS_CHEATSHEET.md
Ruby on Rails Cheatsheet

Ruby on Rails Cheatsheet

Architecture

Create a new application

Install the Rails gem if you haven't done so before

@vingao
vingao / The Many Meanings of Event-Driven Architecture.md
Created January 21, 2022 02:34 — forked from xpepper/The Many Meanings of Event-Driven Architecture.md
My notes on the talk "The Many Meanings of Event-Driven Architecture" by Martin Fowler (GOTO 2017)

GOTO 2017 • The Many Meanings of Event-Driven Architecture - Martin Fowler

(the video is here, the original talk notes are here)

At least one of those four patterns are in play when you talk about "event-driven" architectures:

  1. Event Notification: components communicating via events
  2. Event-carried State Transfer: allowing components to access data without calling the source
  3. Event Sourcing: using an event log as the primary record for a system
  4. CQRS: having a separate component for updating a store from any readers of the store
@vingao
vingao / train.py
Created May 26, 2020 02:43 — forked from RomanSteinberg/train.py
Tensorflow 2.0 VAE example
from __future__ import absolute_import, division, print_function, unicode_literals
from tensorflow.keras import layers
try:
# %tensorflow_version only exists in Colab.
%tensorflow_version 2.x
except Exception:
pass
import tensorflow as tf
@vingao
vingao / GitConfigHttpProxy.md
Created January 26, 2020 02:09 — forked from evantoli/GitConfigHttpProxy.md
Configure Git to use a proxy

Configure Git to use a proxy

In Brief

You may need to configure a proxy server if you're having trouble cloning or fetching from a remote repository or getting an error like unable to access '...' Couldn't resolve host '...'.

Consider something like:

@vingao
vingao / postgres_queries_and_commands.sql
Created June 28, 2019 13:45 — forked from rgreenjr/postgres_queries_and_commands.sql
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%'
@vingao
vingao / install-s3distcp.sh
Created May 12, 2019 03:44 — forked from jordangraft/install-s3distcp.sh
install-s3distcp.sh
$ s3cmd get s3://us-east-1.elasticmapreduce/libs/s3distcp/1.latest/s3distcp.jar
$ hadoop jar ./s3distcp.jar --src s3a://<bucket>/input/ --dest=s3a://<bucket>/output
@vingao
vingao / write_fast_2_s3.py
Created May 12, 2019 01:21 — forked from bachwehbi/write_fast_2_s3.py
Simple approach to accelerate writing to S3 from Spark.
import base64
import os
import time
"""
Writing from Spark to S3 is ridiculously slow. This is because S3 is an object
store and not a file system. Because of consistency model of S3, when writing
Parquet (or ORC) files from Spark. Data will be stored to a temporary destination
then renamed when the job is successful. As S3 is an object store, renaming files
is very expensive (complete rewrite). The Spark job will only terminate when all