Skip to content

Instantly share code, notes, and snippets.

View dansuh17's full-sized avatar
🍩
coffee and what?

Dan Suh dansuh17

🍩
coffee and what?
View GitHub Profile
@dansuh17
dansuh17 / colorscheme.txt
Last active February 3, 2020 05:15
My colorscheme - inspired by "apprentice"
Apprentice colorscheme: https://github.com/romainl/Apprentice
almost_black = ["#1c1c1c", 234, "black"]
darker_grey = ["#262626", 235, "black"]
dark_grey = ["#303030", 236, "darkgrey"]
grey = ["#444444", 238, "darkgrey"]
medium_grey = ["#585858", 240, "darkgrey"]
light_grey = ["#6c6c6c", 242, "lightgrey"]
lighter_grey = ["#bcbcbc", 250, "lightgrey"]
green_grey = #82977C
@dansuh17
dansuh17 / wav_reformat.py
Created December 4, 2019 17:47
reformatting audio files in certain directory as wav file having certain sample rate
import librosa
import os
from scipy.io import wavfile
ROOT = '.'
DIR = 'src' # source directory
TO_DIR = 'dst' # destination directory
SAMPLE_RATE = 16000
for i, fname in enumerate(os.listdir(os.path.join(ROOT, DIR))):
@dansuh17
dansuh17 / Signal reconstruction from spectrograms.ipynb
Created October 3, 2018 14:51 — forked from carlthome/Signal reconstruction from spectrograms.ipynb
Try to recover audio from filtered magnitudes when phase information has been lost.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dansuh17
dansuh17 / wiener_deconvolution_example.py
Created September 12, 2018 09:33 — forked from danstowell/wiener_deconvolution_example.py
Simple example of Wiener deconvolution in Python
#!/usr/bin/env python
# Simple example of Wiener deconvolution in Python.
# We use a fixed SNR across all frequencies in this example.
#
# Written 2015 by Dan Stowell. Public domain.
import numpy as np
from numpy.fft import fft, ifft, ifftshift

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@dansuh17
dansuh17 / compinit.zsh
Created June 1, 2018 15:17 — forked from ctechols/compinit.zsh
Speed up zsh compinit by only checking cache once a day.
# On slow systems, checking the cached .zcompdump file to see if it must be
# regenerated adds a noticable delay to zsh startup. This little hack restricts
# it to once a day. It should be pasted into your own completion file.
#
# The globbing is a little complicated here:
# - '#q' is an explicit glob qualifier that makes globbing work within zsh's [[ ]] construct.
# - 'N' makes the glob pattern evaluate to nothing when it doesn't match (rather than throw a globbing error)
# - '.' matches "regular files"
# - 'mh+24' matches files (or directories or whatever) that are older than 24 hours.
autoload -Uz compinit
@dansuh17
dansuh17 / unsubmodule.md
Created May 29, 2018 06:10 — forked from ryaninvents/unsubmodule.md
Convert git submodule to regular directory

From Stack Overflow.

# Fetch the submodule commits into the main repository
git remote add submodule_origin git://url/to/submodule/origin
git fetch submodule_origin

# Start a fake merge (won't change any files, won't commit anything)
git merge -s ours --no-commit submodule_origin/master
@dansuh17
dansuh17 / http2_curl.sh
Created May 26, 2018 04:40
http2 request using cURL
curl --http2 -k -v https://localhost/get/
@dansuh17
dansuh17 / multipart_upload.sh
Created May 26, 2018 04:37
curl multipart upload
curl -F ‘data=@path/to/file.txt’ https://localhost/upload/
@dansuh17
dansuh17 / uninstall-haskell-osx.sh
Created May 18, 2018 00:20 — forked from gatlin/uninstall-haskell-osx.sh
Uninstall Haskell from Mac OS X
#!/bin/bash
# source: http://www.haskell.org/pipermail/haskell-cafe/2011-March/090170.html
sudo rm -rf /Library/Frameworks/GHC.framework
sudo rm -rf /Library/Frameworks/HaskellPlatform.framework
sudo rm -rf /Library/Haskell
rm -rf .cabal
rm -rf .ghc
rm -rf ~/Library/Haskell