Skip to content

Instantly share code, notes, and snippets.

View bskim45's full-sized avatar

Bumsoo Kim bskim45

View GitHub Profile
@v0lkan
v0lkan / nginx.conf
Last active May 1, 2026 02:49
Configuring NGINX for Maximum Throughput Under High Concurrency
user web;
# One worker process per CPU core.
worker_processes 8;
# Also set
# /etc/security/limits.conf
# web soft nofile 65535
# web hard nofile 65535
# /etc/default/nginx
public class MarketVersionChecker {
public static String getMarketVersion(String packageName) {
try {
Document doc = Jsoup.connect(
"https://play.google.com/store/apps/details?id="
+ packageName).get();
Elements Version = doc.select(".content");
for (Element mElement : Version) {
@PurpleBooth
PurpleBooth / README-Template.md
Last active May 11, 2026 16:34
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

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;
@kizbitz
kizbitz / dockerhub-v2-api-user.sh
Last active April 17, 2023 23:30
Get the list of images and tags for a Docker Hub user account.
#!/bin/bash
# Example for the Docker Hub V2 API
# Returns all imagas and tags associated with a Docker Hub user account.
# Requires 'jq': https://stedolan.github.io/jq/
# set username and password
UNAME=""
UPASS=""
@colinvh
colinvh / aws.md
Last active May 11, 2026 07:36
AWS Region Names

Alternative naming schemes for AWS regions

Incorporates changes by 0mnius.

Purpose

The intent is to define terse, standards-supported names for AWS regions.

Legend

@jmindek
jmindek / gist:62c50dd766556b7b16d6
Last active January 31, 2024 15:48
DISTINCT ON like functionality for Redshift

distinct column -> For each row returned, return only the unique members of a set. Think of it as for each row in a projection, concatenate all the column values and return only the strings that are unique.

test_db=# SELECT DISTINCT parent_id, child_id, id FROM test.foo_table ORDER BY parent_id, child_id, id LIMIT 10;
parent_id | child_id | id
-----------+------------+-----------------------------
1000040 | 103 | 1000040|2645405726|0001|103
@simonrw
simonrw / python_pymysql_notes.md
Created September 18, 2015 19:01
Notes about pymysql connections

Database transactions

pymysql

  • Defaults to autocommit=False
connection = pymysql.connect(user='user', db='test')
cursor = connection.cursor()
cursor.execute('insert into test (value) values (10)')
@kibotu
kibotu / activity.java
Last active June 14, 2018 08:38
handle hide keyboard functionality on focus lost properly on android
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
final Fragment fragment = getSupportFragmentManager().findFragmentById(R.id.fragment_container);
if (fragment instanceof IDispatchTouchEvent)
return ((IDispatchTouchEvent) fragment).dispatchTouchEvent(ev) || super.dispatchTouchEvent(ev);
return super.dispatchTouchEvent(ev);
}
@felipecsl
felipecsl / ExceptionParser.java
Last active January 28, 2019 12:42
Helper class to parse error response body on Retrofit 2
public static class ExceptionParser {
private final ResponseBody body;
private final String bodyString;
private final Converter.Factory converterFactory;
public ExceptionParser(Response response, Converter.Factory converterFactory) {
this.converterFactory = converterFactory;
this.body = cloneResponseBody(response.errorBody());
this.bodyString = getBodyAsString(body);
}