Skip to content

Instantly share code, notes, and snippets.


(Bill) Yuchen Lin yuchenlin

Block or report user

Report or block yuchenlin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View tmux_cheatsheet.markdown

tmux cheatsheet

As configured in my dotfiles.

start new:


start new with session name:

tmdavid /
Last active Sep 20, 2019
Visualize word embeddings, using tsne.
Visualize word embeddings, using tsne.
First computes cosine distance of the 100 closests words, and then shows a clustering graph
of the first 11 closest words (the first one is always the word)
line 31: glove_file = '../TBIR/glove.840B.300d.txt' MODIFY with the appropiate path
To Use it, you can just type: python <list of words space separated>
e.g: python cake word embedding music
mblondel /
Last active Sep 18, 2019
Learning to rank metrics.
# (C) Mathieu Blondel, November 2013
# License: BSD 3 clause
import numpy as np
def ranking_precision_score(y_true, y_score, k=10):
"""Precision at rank k
evanwill /
Last active Sep 16, 2019
how to add more utilities to git bash for windows, wget, make

How to add more to Git Bash on Windows

Git for Windows comes bundled with the "Git Bash" terminal which is incredibly handy for unix-like commands on a windows machine. It is missing a few standard linux utilities, but it is easy to add ones that have a windows binary available.

The basic idea is that C:\Program Files\Git\mingw64\ is your / directory according to Git Bash (note: depending on how you installed it, the directory might be different. from the start menu, right click on the Git Bash icon and open file location. It might be something like C:\Users\name\AppData\Local\Programs\Git, the mingw64 in this directory is your root. Find it by using pwd -W). If you go to that directory, you will find the typical linux root folder structure (bin, etc, lib and so on).

If you are missing a utility, such as wget, track down a binary for windows and copy the files to the corresponding directories. Sometimes the windows binary have funny prefixes, so

nathanielove /
Created Nov 1, 2016
How to setup Shadowsocks on your Ubuntu server

How to setup Shadowsocks on your Ubuntu server

Your school or company network may block the access to a few specific websites. To solve this problem, I'd highly recommend Shadowsocks, since it is the easiest proxy tool I've ever found, and it's FREE (of course iff you have your own server running).

First, ssh to your server, and make sure you have Python and pip installed. If you have Python but not pip, install it using the following command

$ sudo apt-get install python3-pip
jtilly /
Last active Aug 29, 2019
Install GCC 4.9.3
# this script installs GCC 4.9.3
# to use it navigate to your home directory and type:
# sh
# download and install gcc 4.9.3
tar xzf gcc-4.9.3.tar.gz
cd gcc-4.9.3
# this script installs GCC 5.4.0
# to use it navigate to your home directory and type:
# sh
# download and install gcc 4.9.3
tar xzf gcc-5_4_0-release.tar.gz
cd gcc-5_4_0-release
Tushar-N /
Last active Aug 20, 2019
How to use pad_packed_sequence in pytorch
import torch
import torch.nn as nn
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
seqs = ['gigantic_string','tiny_str','medium_str']
# make <pad> idx 0
vocab = ['<pad>'] + sorted(set(''.join(seqs)))
# make model
bbengfort /
Last active Jul 25, 2019
Interactive JSON explorer using Python's cmd module
#!/usr/bin/env python
# jsonexplorer
# An interactive interface to explore JSON documents
# Author: Benjamin Bengfort <>
# Created: Wed Jun 17 12:15:23 2015 -0400
# Copyright (C) 2015
# Licensed under the OSI Approved MIT License
misberner / .gitignore-latex
Created Jan 8, 2014
.gitignore rules for LaTeX projects
View .gitignore-latex
# LaTeX temporary files
# PDF output - usually a bad idea to keep this in Git
# Latexmk
You can’t perform that action at this time.