Skip to content

Instantly share code, notes, and snippets.

View JasonTam's full-sized avatar
🍣
⊂(´・◡・⊂ )∘˚˳°

Jason Tam JasonTam

🍣
⊂(´・◡・⊂ )∘˚˳°
View GitHub Profile
@JasonTam
JasonTam / .i3config
Created February 6, 2015 03:25
i3 config
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout somewhen, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
/server add twitch irc.twitch.tv/6667 -password=oauth:****************************** -username=TWITCHUSERNAME -nicks=TWITCHUSERNAME
/join TWITCHCHANNEL
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@JasonTam
JasonTam / benchmark_sparse_pos_check.ipynb
Last active June 7, 2017 21:05
sparse neg sampling benchmark
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@JasonTam
JasonTam / samson_co1u_linux.md
Last active April 28, 2021 02:50
Samson C01U microphone remap hack

The SAMSON CO1U microphone uses a stereo chip where the left channel should be the final output. However, on linux, we see the post-proc(left) and raw(right) signals separately. To fix this, we can map the left channel to both channels reducing to a proper mono channel. (Compare to setting a mono signal on pavucontrol which gives a screwed up noisy signal).

Add the following line to /etc/pulse/default.pa (or whichever file is being used -- see http://manpages.ubuntu.com/manpages/bionic/man5/default.pa.5.html )

# SAMSON CO1U HACK
.nofail
load-module module-remap-source source_name=samson-co1u-hack master=alsa_input.usb-Samson_Technologies_Samson_C01U-00.analog-stereo master_channel_map=left,left channel_map=left,right remix=false
.fail
@JasonTam
JasonTam / parq_vs_avro_msg.ipynb
Last active October 24, 2017 16:22
Comparison of avro, msgpack, parquet
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@JasonTam
JasonTam / approx_auc_dist.ipynb
Created November 1, 2017 15:15
Calculating AUC can take a long-ass time for large number of samples
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@JasonTam
JasonTam / lightfm_freeze-emb_example.ipynb
Last active November 7, 2017 20:14
example of how to freeze embeddings in lightfm by exploiting the accumulated gradient in adagrad
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@JasonTam
JasonTam / binary_search_membership.py
Last active February 28, 2018 01:20
Most of the time `in` is good enough (even for lists)
from bisect import bisect_left
def in_bs(a, x):
i = bisect_left(a, x)
return (i != len(a)) and (a[i] == x)