Skip to content

Instantly share code, notes, and snippets.

View jaekookang's full-sized avatar
🎯
Focusing

jkang jaekookang

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

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 April 20, 2022 01:06 — forked from kevinxhan/signal.py
python catch kill signal
#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:
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 November 29, 2021 02:44 — 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
/**
* @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 June 10, 2022 14:30
ffmpeg custom shell functions
# 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 November 24, 2021 06:04 — forked from hosackm/flaskaudiostream.py
Flask streaming an audio file
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 September 15, 2021 05:50 — forked from ramnathv/gh-pages.md
Creating a clean gh-pages branch

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 September 14, 2021 10:25 — forked from hadware/bytes_to_wav.py
Convert wav in bytes for to numpy ndarray, then back to bytes
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 April 9, 2021 20:14
category_64_2021-04-09
{
"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"