This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Typically, mordern client systems limit it 60 milliseconds | |
const FRAME_LIMIT = 100 // milliseconds, naaive | |
const TDFC = (MAXROW, cb) => { | |
return new Promise(resolve => { | |
const maxRow = MAXROW; | |
let cursor = 1; // start point | |
let partialMax = 10; // minimal loop block | |
let before = new Date().getTime(); | |
let result; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Warning!: It is not yet prevented for race condition! | |
const mine = { js: { type: 'application/javascript' } }; | |
const WorkerPromise = f => { | |
let resolve; | |
let reject; | |
const worker = Object.assign( | |
new Worker( | |
URL.createObjectURL( | |
new Blob([`onmessage = e => postMessage((${f})(e.data));`], mine.js), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ExcelJS = require('exceljs'); | |
const workbook = new ExcelJS.Workbook(); | |
const data = await workbook.xlsx.readFile('./test.xlsx'); | |
const worksheet = workbook.worksheets[0]; | |
for (const image of worksheet.getImages()) { | |
console.log('processing image row', image.range.tl.nativeRow, 'col', image.range.tl.nativeCol, 'imageId', image.imageId); | |
// fetch the media item with the data (it seems the imageId matches up with m.index?) | |
const img = workbook.model.media.find(m => m.index === image.imageId); | |
fs.writeFileSync(`${image.range.tl.nativeRow}.${image.range.tl.nativeCol}.${img.name}.${img.extension}`, img.buffer); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 개발환경을 새로 잡을 일이 있어서 defualt setting을 기록 | |
# Install bundle with pathogen for package manage | |
> mkdir -p ~/.vim/autoload ~/.vim/bundle && \ | |
> curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim | |
# Init pathogen | |
# No source, parsed from vim | |
> echo "execute pathogen#infect()" >> ~/.vimrc | |
# execute pathogen#infect() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Memo for new_dev_env | |
# Install zsh to shell theme | |
# MAC(Catalina~) default shell is zsh already | |
# 1. Install zsh | |
> sudo apt install zsh | |
> brew install zsh(MAC) | |
# 2. Change bash to zsh | |
# and select option: 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# How to set github on MacOS | |
# First if you use wsl2 ubuntu, try this: git.exe clone [remote-repo] | |
# Or git config --global credential.helper "/mnt/c/Program\ Files/Git/mingw64/libexec/git-core/git-credential-manager-core.exe" | |
# 1. Generate public key | |
$ ssh-keygen -t ed25519 -C "your_email@example.com" | |
# 2. Copy to clipboard public key | |
$ pbcopy ~/.ssh/id_ed25519.pub | |
# 2-1) if on Ubuntu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Also you need to alias command or make shell script | |
# alias diff="git diff --no-index" | |
git diff --no-index some/path other/path >> some_filename |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 0. Move home directory | |
$ cd ~ | |
# 1. Rename corrupted zsh_history | |
$ mv .zsh_history .zsh_history_bad | |
# 2. Encoding zsh_history_bad | |
$ strings -eS .zsh_history_bad > .zsh_history | |
# 3. Read history from file | |
$ fc -R .zsh_history |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
$ sudo update-alternatives --config editor | |
There are 4 choices for the alternative editor (providing /usr/bin/editor). | |
Selection Path Priority Status | |
------------------------------------------------------------ | |
* 0 /bin/nano 40 auto mode | |
1 /bin/ed -100 manual mode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
minikube start --driver=docker |
OlderNewer