Skip to content

Instantly share code, notes, and snippets.

View chi-feng's full-sized avatar

Chi Feng chi-feng

View GitHub Profile
@chi-feng
chi-feng / preamble
Created September 17, 2013 01:38
Latex Listings language definition/style for Julia
\usepackage{inconsolata} % very nice fixed-width font included with texlive-full
\usepackage[usenames,dvipsnames]{color} % more flexible names for syntax highlighting colors
\usepackage{listings}
\lstset{
basicstyle=\ttfamily,
columns=fullflexible, % make sure to use fixed-width font, CM typewriter is NOT fixed width
numbers=left,
numberstyle=\small\ttfamily\color{Gray},
stepnumber=1,
conda install -c conda-forge jupyter_contrib_nbextensions
conda install -c conda-forge jupyter_nbextensions_configurator
conda install -c conda-forge gensim
conda install -c conda-forge spacy
python -m spacy download en_core_web_sm
@chi-feng
chi-feng / git_examples.sh
Last active October 9, 2019 12:58
99% of the Git commands you'll need at work, demonstrated in a single script (credit BitPusher16)
#!/bin/bash
##########
# contents
##########
# contents
# notes
# script setup
# git config files
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@chi-feng
chi-feng / pagerank.ipynb
Created October 18, 2019 22:44
pagerank.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@chi-feng
chi-feng / github_ssh_auth.md
Created January 9, 2020 21:59
github ssh auth
  1. run ssh-keygen and press enter repeatedly until done. This creates a public/private key pair in ~/.ssh/
  2. run cat ~/.ssh/id_rsa.pub to print out the public key
  3. copy the key to your clipboard
  4. visit https://github.com/settings/keys and click [New SSH key] and paste your key when prompted
  5. You're done!

Now you can git clone via ssh (make sure to copy the repository url for cloning using SSH instead of HTTPS). The repository url should look like: git@github.com:user/repo.git

Original CSS

body {
	font-size: 14px;
	font-family: Helvetica, Arial, sans-serif;
	line-height: 1.4;
}

.header {
	color: red;
@chi-feng
chi-feng / twitter_replies.ipynb
Created January 27, 2021 07:54
Twitter reply scraper using Tweepy
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@chi-feng
chi-feng / gist:f72cb0b9f82efb06751c9e2bc5f31862
Created March 11, 2021 16:23
matplotlib latex configuration
# need to set configuration before import pyplot from matplotlib
import matplotlib
matplotlib.rc('font', size='10')
matplotlib.rc('text', usetex=True)
matplotlib.rc('font', family='serif')
matplotlib.rc('font' ,serif='Computer Modern')
matplotlib.rcParams['text.latex.preamble']=[r"\usepackage{amsmath}\usepackage{amsfonts}\usepackage{amssymb}"]
0eNrsvV2PI0eW3/1VCnX12GAJGe8RgtcXhmHYwFwsoPHVjNBgd7FbxFQXyyyWdoSFvvsTySRZ7GIE8/+rlmdhrxcLadSd+Y/Ic+KcODyv/3r78eFl9bRdP+4+fNxs/nb747++/snz7Y9/OfvP8e/uV8+ftuun3XrzePvj7X95WT/c3+x+WT8v6j9Xjzf/slzvbj5vtjc/bR6W2+X95ubP2+X68fC3z7vl16ebnz4tP3/ePNx/84f/vHxcPfxw86fN45eb5/X96mbzefqzm68vz7ubj6ubp4flp9X9zePq77ub3WZ8aP345Ye/Pv718ac9wvLmp93maXGz3eyWu9WNycPN/erLdrWqe1s+3h/WWT5u6qrb/bM367r68usBegT9tF2N7y5v7jcvHx9W+6d+uF3cPj8un+52m7sv2/X9SIW/3/5obF7c/rb/9++L2+XH583Dy251Nz75VDd2++Nu+7Ja3D5tntcjse62q4flbv3r6i1M3KPcmVhR1p82jxPNn9dfHpcP4zO7355WldLr3epr3chj3W79r91I1Lvnurvb8bXH+9UI9fui8eKv6+3upf7J6d3piTt79qb9/efF7epxV3e6mtbf/8dvHx5fvn5cbSv06e1PL9tfV/d3df0R8vh1h4+J08eEoULfr7erT9PfxXFjbxDt637Gj/nyy66Dmcwe05dvMW0D08mYTsb0MmaQMYOMmWTMKGMWGTOpmFnnUZYxdR4VGVPnkRlkUJ1JxsigOpeMLEpFZ5ORZanofDKyMBXAKFmaCmCULE4FMEqWJzMATmUdFbCq6Kg6r+ygo+rMskZH1bllZbEyRueWdTqqzi3rdVTAraCjAm5FHRVwS5ctC7ily5YF3NJly+rccrpsWZ1bTpctq3PL6bLlgPmny5bTueV02XKAW7psOcAtXbYc4JYuWx5wS5ctD7ily5bXueV12fI6t7wuW17nltdlK+jc8rpsBfDjSpetALily1YA3NJlKwBu6bIVAbd02YqAW7psRfBjWJetqHM