Skip to content

Instantly share code, notes, and snippets.

View bskim45's full-sized avatar

Bumsoo Kim bskim45

View GitHub Profile
@bskim45
bskim45 / README.md
Last active February 6, 2023 09:48
BigQuery Audit Log Cheatsheet (Cloud Logging)
@bskim45
bskim45 / README.md
Last active October 20, 2023 09:24
atlantis cheatsheet

atlantis cheatsheet

Plan/apply only for a target resource

atlantis plan -d path/to/workspace -- -target target_resource

Destroy a workspace

@bskim45
bskim45 / I'm a night 🦉
Last active July 26, 2023 00:03
I'm a night 🦉
🌞 Morning 53 commits █▏░░░░░░░░░░░░░░░░░░░ 5.8%
🌆 Daytime 348 commits ████████░░░░░░░░░░░░░ 38.2%
🌃 Evening 424 commits █████████▊░░░░░░░░░░░ 46.6%
🌙 Night 85 commits █▉░░░░░░░░░░░░░░░░░░░ 9.3%
@bskim45
bskim45 / 💻 Recent coding in languages
Last active June 8, 2023 00:09
💻 Recent coding in languages
Markdown +62/ -36 ██████████████▉░░░░░░ 71.0%
JSON +11.1k/ -6.4k ██▊░░░░░░░░░░░░░░░░░░ 13.7%
HTML +12/ -12 ██▌░░░░░░░░░░░░░░░░░░ 12.1%
YAML +151/ -104 ▋░░░░░░░░░░░░░░░░░░░░ 3.0%
TOML +10/ -6 ░░░░░░░░░░░░░░░░░░░░░ 0.2%
Python +2/ -0 ░░░░░░░░░░░░░░░░░░░░░ 0.0%
JavaScript +48/ -34 ░░░░░░░░░░░░░░░░░░░░░ 0.0%
@bskim45
bskim45 / package.scala
Last active January 8, 2021 16:29
Scala Parallel Collection with parallelism level
/** Parallel Collection with parallelism level
*
* Changes the task support of a parallel collection to use a fork-join pool
* with desired parallelism level
*
* Usage:
* {{{
* Seq(1, 2, 3, 4).par.withCores(Runtime.getRuntime.availableProcessors * 2).map(_ * 2).sum
* }}}
*
@bskim45
bskim45 / redshift_copy.sql
Last active September 20, 2019 09:32
Collection of Redshift Utility Queries
-- Identify how many S3 objects each COPY command loads
SELECT
query, COUNT(*) num_files,
ROUND(MAX(wq.total_exec_time/1000000.0),2) execution_secs,
ROUND(SUM(transfer_size)/(1024.0*1024.0),2) total_mb,
SUBSTRING(querytxt,1,60) copy_sql
FROM stl_s3client s
JOIN stl_query q USING (query)
JOIN stl_wlm_query wq USING (query)
WHERE s.userid>1 AND http_method = 'GET'
@bskim45
bskim45 / pre-receive
Created July 10, 2019 10:26
python + flake8 pre-receive git hook
#!/bin/bash
if test -n "$GIT_PUSH_OPTION_COUNT"
then
i=0
while test "$i" -lt "$GIT_PUSH_OPTION_COUNT"
do
eval "value=\$GIT_PUSH_OPTION_$i"
case "$value" in
force)
@bskim45
bskim45 / APIGateway.md
Last active March 10, 2023 15:41
CloudWatch Logs Insights query for API Gateway

Req id:

parse @message '(*) *' as reqId, message
| filter reqId like "c19dd3fc-5f27-11e9-a823-930d231e2ab8"
| sort @timestamp asc
| limit 50

Status code:

from pynamodb.models import Model
from pynamodb.attributes import UnicodeAttribute, NumberAttribute
class MyModel(Model):
class Meta:
table_name = 'mytable'
group = UnicodeAttribute(hash_key=True)
id = NumberAttribute(range_key=True)
import java.awt.*;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.concurrent.*;
import javax.imageio.ImageIO;
import javax.swing.JComponent;