Skip to content

Instantly share code, notes, and snippets.

View mingrammer's full-sized avatar
🧗
learn, code, and grow

MinJae Kwon (Miti) mingrammer

🧗
learn, code, and grow
View GitHub Profile
@mingrammer
mingrammer / click.go
Last active November 8, 2024 15:38
Button click handler
package main
import (
"fmt"
"time"
)
type eventType int
const (
1111#recent_clicked_articles 1 2 3 4
Score 1700000000 1710000000 1720000000 1730000000
Member {"article_id": 1} {"article_id": 2} {"article_id": 3} {"article_id": 4}
Partition Key Sort Key Value
1111#region_id null 1234
2222#region_id null 5678
1111#notification_keywords null ["자전거", "아이폰", "에어팟"]
1111#recent_clicked_articles 1700000000 {"article_id": 1}
1111#recent_clicked_articles 1710000000 {"article_id": 2}
1111#recent_clicked_articles 1720000000 {"article_id": 3}
1111#recent_clicked_articles 1730000000 {"article_id": 4}
Key Value
1111#region_id 1234
2222#region_id 5678
1111#notification_keywords ["자전거", "아이폰", "에어팟"]
1111#recent_clicked_articles [{"article_id": 1, "timestamp": 1700000000}, {"article_id": 2, "timestamp": 1710000000}, {"article_id": 3, "timestamp": 1720000000}, {"article_id": 4, "timestamp": 1730000000}]
@mingrammer
mingrammer / keybase.md
Created October 10, 2018 09:14
Keybase proof

Keybase proof

I hereby claim:

  • I am mingrammer on github.
  • I am mingrammer (https://keybase.io/mingrammer) on keybase.
  • I have a public key ASCozwJWH7JP75YzsTAPDo-5h-mAz5CqxIhs-TVmQU--xgo

To claim this, I am signing this object:

@mingrammer
mingrammer / turn.py
Last active August 18, 2018 23:41
pycon-2018-banksalad-holdem
from typing import List
from .core.cards import Card
from .core.madehands import evaluate
from .player import Other
def bet(
my_chips: int,
my_cards: List[Card],
@mingrammer
mingrammer / download-csv-from-browser.js
Last active November 28, 2024 12:12
Download CSV files directly from your browser
function createCSV(data) {
var lineDelimiter = '\n';
var csv = {
'title': '',
'head': '',
'body': ''
};
csv.title = 'csv-title.csv';
csv.head = '...'; // make your own csv head
@mingrammer
mingrammer / seoul-metro-max-min-in-out-elasticsearch.py
Last active January 23, 2018 02:55
Get the maximum and minimum numbers of people in/out for seoul metro using elasticsearch
import math
from pprint import pprint
import elasticsearch as es
import numpy as np
# Constants
INDEX_NAME = 'seoul-metro-2014'
THRESHOLD = 10
CHUNK_SIZE = 5000
@mingrammer
mingrammer / two-ways-of-if-statement.py
Created May 25, 2017 09:24
Two styles of writing 'if' statement
### without elif, else
if cond == 'one':
# something
return # or break
if cond == 'two':
# something
return # or break
# something
return # or break
numbers = [1, 2, 3, 4, 5, 6]
# The left side of unpacking should be list or tuple.
*a, = numbers
# a = [1, 2, 3, 4, 5, 6]
*a, b = numbers
# a = [1, 2, 3, 4, 5]
# b = 6