Skip to content

Instantly share code, notes, and snippets.

View WoonHaKim's full-sized avatar
⚙️
Creating Value

Woona Kim WoonHaKim

⚙️
Creating Value
  • Volla Inc.
  • Seoul. South Korea
View GitHub Profile
@WoonHaKim
WoonHaKim / SomeViewManager.m
Created November 14, 2021 11:44
Call instance methods safely in RN
// C MACROs are not available in swift, so this format is prefered to use in Obj-C
RCT_EXPORT_METHOD(methodFoo:(NSNumber * __nonnull)reactTag //... whatever){
[self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager,
NSDictionary<NSNumber *, SomeView *> *viewRegistry) {
SomeView *view = viewRegistry[reactTag];
if (![view isKindOfClass:[IvsPublisherView class]]) {
RCTLogError(@"Invalid view returned from registry, expecting SomeView, got: %@", view);
}
@WoonHaKim
WoonHaKim / example.ios.yml
Last active July 17, 2023 03:43
GitHub Action iOS build workflow example
name: Example iOS Build
on:
push:
branches:
- development
jobs:
build-ios:
runs-on: macos-latest
@WoonHaKim
WoonHaKim / exampleDist.sh
Last active January 27, 2020 14:50
exampleDist.sh
#!bin/bash
# .env의 위치
export ENV_FILE=ENVIRONMENT_FILE_HERE
# build가 끝난 폴더의 위치 (ex. ./dist)
export BUILD_FOLDER=BUILD_FOLDER_HERE
# s3 bucket 및 폴더의 위치
export S3_BUCKET_DESTINATION=s3://bucket_name/destination
# Invalidate 할 폴더의 위치
export CDN_DISTRIBUTION_ID=CLOUDFRONT_DIST_HERE
@WoonHaKim
WoonHaKim / callbackToPromise.js
Last active January 16, 2020 13:36
Callback to Promise
import {someApi} from "someApi"
const somePromiseFct = (params) => {
return new Promise((resolve, reject) => {
//... ex. callbackFct는 callback으로 data를 준다고 합니다
someApi.callbackFct(params, (data, error) => {
//... data를 처리
if (error) return reject(error);
resolve(data);
})
@WoonHaKim
WoonHaKim / hls_s3_archive.py
Last active January 15, 2020 17:37
Functions for ffmpeg bundling
import sys
import subprocess
import os
import video_cmds
task_id = sys.argv[1]
src_s3_path = sys.argv[2]
dst_s3_path = sys.argv[3]
file_max_length = 300
@WoonHaKim
WoonHaKim / router.ts
Last active March 7, 2022 00:25
Serverless + sls-http + koa example
// written typescript
import { APIGatewayEvent, Context, Handler } from "aws-lambda";
import Koa from "Koa";
import Router from "koa-router";
import serverlessHttp from "serverless-http";
// for serverless offline
export interface SlsExtendableOfflineEvent extends APIGatewayEvent {
@WoonHaKim
WoonHaKim / nginx-rtmp.conf
Created October 12, 2018 01:51
nginx-rtmp config example
rtmp {
server{
listen 1935;
chunk_size 256;
buflen 100ms;
application live {
live on;
# dash on;
@WoonHaKim
WoonHaKim / P5DynamicLoader.js
Created October 2, 2018 12:30
Connecting p5js and React js
// Uses dynamic component loading feature of nextjs
import dynamic from 'next/dynamic';
import sketch from './BGSketch'; // Sketch to load dynamically
import css from '../styles.less'
const P5DynamicLoader = dynamic(import('./P5Wrapper'), {
ssr: false,
loading: () => <div className={css.backgroundCanvas}>Loading Background...</div>,
});