Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

jkang jaekookang

🎯
Focusing
View GitHub Profile
@jaekookang
jaekookang / private_fork.md
Created Aug 19, 2022 — forked from 0xjac/private_fork.md
Create a private fork of a public repository
View private_fork.md

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

@jaekookang
jaekookang / signal.py
Created Apr 20, 2022 — forked from kevinxhan/signal.py
python catch kill signal
View signal.py
#We can check for Ctrl-C with KeyboardInterrupt exception as follows:
try:
while True:
print "Echo ", raw_input(">")
except KeyboardInterrupt:
print "Good bye"
#When python process was killed, we will not get KeyboardInterrupt. But we can instead catch SIGTERM sent by kill command.
#In order to catch SIGTERM, we can do:
View dotdict.py
class DotDict(dict):
"""
a dictionary that supports dot notation
as well as dictionary access notation
useful when using it with TensorFlow or PyTorch
Usage:
d = DotDict() or d = DotDict({'val1':'first'})
set attributes: d.val2 = 'second' or d['val2'] = 'second'
@jaekookang
jaekookang / OrbitControls.js
Created Nov 29, 2021 — forked from mrflix/OrbitControls.js
Three.OrbitControls for multiple instances on a page.Usage: controls = new THREE.OrbitControls(camera, document, renderer.domElement); Based on: http://threejs.org/examples/js/controls/OrbitControls.js
View OrbitControls.js
/**
* @author qiao / https://github.com/qiao
* @author mrdoob / http://mrdoob.com
* @author alteredq / http://alteredqualia.com/
* @author WestLangley / http://github.com/WestLangley
* @author erich666 / http://erichaines.com
* @author mrflix / http://felixniklas.de
*
* released under MIT License (MIT)
*/
@jaekookang
jaekookang / ffmpeg_utils.sh
Last active Jun 10, 2022
ffmpeg custom shell functions
View ffmpeg_utils.sh
# ffmpeg custom utilities
#
# To use:
# source ffmpeg_utils.sh
#
# URL: https://gist.github.com/jaekookang/6a5829e00f38ed01da224076ca4960d9
#
# 2021-11-25 first created jaekoo kang
function ffmpeg_mkv_mp4() {
@jaekookang
jaekookang / flaskaudiostream.py
Created Nov 24, 2021 — forked from hosackm/flaskaudiostream.py
Flask streaming an audio file
View flaskaudiostream.py
from flask import Flask, Response
app = Flask(__name__)
@app.route("/wav")
def streamwav():
def generate():
with open("signals/song.wav", "rb") as fwav:
data = fwav.read(1024)
@jaekookang
jaekookang / gh-pages.md
Created Sep 15, 2021 — forked from ramnathv/gh-pages.md
Creating a clean gh-pages branch
View gh-pages.md

Creating a clean gh-pages branch

This is the sequence of steps to follow to create a root gh-pages branch. It is based on a question at [SO]

cd /path/to/repo-name
git symbolic-ref HEAD refs/heads/gh-pages
rm .git/index
git clean -fdx
echo "My GitHub Page" > index.html
@jaekookang
jaekookang / bytes_to_wav.py
Created Sep 14, 2021 — forked from hadware/bytes_to_wav.py
Convert wav in bytes for to numpy ndarray, then back to bytes
View bytes_to_wav.py
from scipy.io.wavfile import read, write
import io
## This may look a bit intricate/useless, considering the fact that scipy's read() and write() function already return a
## numpy ndarray, but the BytesIO "hack" may be useful in case you get the wav not through a file, but trough some websocket or
## HTTP Post request. This should obviously work with any other sound format, as long as you have the proper decoding function
with open("input_wav.wav", "rb") as wavfile:
input_wav = wavfile.read()
@jaekookang
jaekookang / projector.config
Last active Apr 9, 2021
category_64_2021-04-09
View projector.config
{
"embeddings": [
{
"tensorName": "category_64_2021-04-09",
"tensorShape": [
12799,
100
],
"tensorPath": "https://gist.githubusercontent.com/jaekookang/0ea1946dbaf08931ca247446a11b28b4/raw/372923af67fdc4c5a83f4989ede636ca9bee77df/img_embed.tsv",
"metadataPath": "https://gist.githubusercontent.com/jaekookang/de5e5ff57fb71788d2e4d33ff31acf42/raw/d6b57aa84aa77e571759c3726d38941894bedcbf/img_label.tsv"
@jaekookang
jaekookang / img_label.tsv
Created Apr 9, 2021
category_64_2021-04-09
View img_label.tsv
ID Category Filename
1 animal-bird 01_animal-bird_001
1 animal-bird 01_animal-bird_002
1 animal-bird 01_animal-bird_003
1 animal-bird 01_animal-bird_004
1 animal-bird 01_animal-bird_005
1 animal-bird 01_animal-bird_006
1 animal-bird 01_animal-bird_007
1 animal-bird 01_animal-bird_008
1 animal-bird 01_animal-bird_009