Skip to content

Instantly share code, notes, and snippets.

View Jungwoo-An's full-sized avatar
🚀

Jungwoo An Jungwoo-An

🚀
View GitHub Profile
@Jungwoo-An
Jungwoo-An / string.ts
Last active September 4, 2018 10:08
snake_case <-> camelCase
export function namingSnakeToCamel(text: string) {
return text.replace(/_(\w)/g, (match, target: string) => target.toUpperCase());
}
@Jungwoo-An
Jungwoo-An / settings.py
Created August 21, 2018 13:04
Django spa config
STATIC_URL = '/static/'
STATICFILES_DIRS = (os.path.join(BASE_DIR, 'static'),)
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'static')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
@Jungwoo-An
Jungwoo-An / debounce-promise.ts
Last active November 26, 2019 01:51
combine resolved promise
export function debounceUntilResolve(func: any) {
let isDone = true;
return async (...args: any[]) => {
if (!isDone) {
return;
}
isDone = false;