Skip to content

Instantly share code, notes, and snippets.

View jeemyeong's full-sized avatar

Leo(Jeemyeong) Lee jeemyeong

View GitHub Profile
from reactivex import operators as ops
from reactivex.subject import Subject
class GroupMessageProcessor:
def __init__(self, interval_seconds=1):
self.interval_seconds = interval_seconds
self.subject = Subject()
self._initialize_stream()
@jeemyeong
jeemyeong / spaceship-doppler.plugin.zsh
Created February 8, 2024 04:24
spaceship-doppler.plugin.zsh
#
# doppler
# ------------------------------------------------------------------------------
# Configuration
# ------------------------------------------------------------------------------
SPACESHIP_DOPPLER_SHOW="${SPACESHIP_DOPPLER_SHOW=true}"
SPACESHIP_DOPPLER_ASYNC="${SPACESHIP_DOPPLER_ASYNC=true}"
SPACESHIP_DOPPLER_PREFIX="${SPACESHIP_DOPPLER_PREFIX="$SPACESHIP_PROMPT_DEFAULT_PREFIX"}"
@jeemyeong
jeemyeong / README.org
Created March 2, 2021 00:55 — forked from jcouyang/README.org
Promise All with Limit of Concurrent N

The Promise All Problem

in case of processing a very large array e.g. Promise.all(A_VERY_LARGE_ARRAY_OF_XHR_PROMISE)

which would probably blow you browser memory by trying to send all requests at the same time

solution is limit the concurrent of requests, and wrap promise in thunk

Promise.allConcurrent(2)([()=>fetch('BLAH1'), ()=>fetch('BLAH2'),...()=>fetch('BLAHN')])

productive-box
@jeemyeong
jeemyeong / sentryMiddleware.ts
Created August 9, 2019 12:31
import createSentryMiddleware from "redux-sentry-middleware";
import * as Sentry from "@sentry/browser";
import createSentryMiddleware from "redux-sentry-middleware";
import { Context } from "../../common/Context";
Sentry.init({ dsn: process.env.PRODUCTION_SENTRY_DSN });
Sentry.configureScope(scope => {
const filteredUser = {
...Context.user,
phoneNumber: "FILTERED",
@jeemyeong
jeemyeong / tmux-cheatsheet.markdown
Created April 25, 2019 02:16 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@jeemyeong
jeemyeong / webpack.common.js
Created February 20, 2019 12:34
webpack plugin
class HelloWorldPlugin {
apply(compiler) {
compiler.hooks.done.tap('Hello World Plugin', (stats) => {
console.log('Hello World!');
});
}
}
config.plugins = [
function() {
class Solution:
def nthSuperUglyNumber(self, n: 'int', primes: 'List[int]') -> 'int':
from heapq import heappop, heappush
q = [1]
ret = []
visited = set()
for _ in range(n+1):
cur = heappop(q)
for p in primes:
@jeemyeong
jeemyeong / downloads.sh
Created January 30, 2019 04:53
download files
cat url.txt | xargs wget
@jeemyeong
jeemyeong / .babelrc
Created January 26, 2019 04:29
sample webpack babel
{
"presets": [
"@babel/preset-env",
// "@babel/preset-react"
]
}