Skip to content

Instantly share code, notes, and snippets.

@unisolate
unisolate / debug.cc
Created July 2, 2020 13:11
Template for debugging
#include <bits/stdc++.h>
using namespace std;
template <typename A, typename B>
string to_string(pair<A, B> p);
template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);
@unisolate
unisolate / .tmux.conf
Created October 18, 2018 05:28
tmux configure
set -g default-terminal "screen-256color" # Use 256 colors
# Start window indexing at one instead of zero
set -g base-index 1
set-window-option -g pane-base-index 1
set-window-option -g mode-keys vi
# Set the prefix key and some key bindings to match GNU Screen
unbind C-b
@unisolate
unisolate / .vimrc
Last active June 16, 2021 06:56
vimrc
" General
set term=xterm-256color
syntax enable
set background=dark
colorscheme solarized
set tabstop=4
set softtabstop=4
set expandtab
set number
set showcmd
@unisolate
unisolate / init.lua
Created October 18, 2018 05:26
Hammerspoon config
hs.grid.MARGINX = 0
hs.grid.MARGINY = 0
hs.grid.GRIDWIDTH = 8
hs.grid.GRIDHEIGHT = 8
local hyper = {'ctrl', 'alt'}
local LAYOUTS = {
full = {0, 0, 8, 8},
center = {1, 1, 6, 6},
@unisolate
unisolate / tgfan.py
Created June 1, 2018 14:51
telegram bot for fanfou
from telegram import (User)
from telegram.ext import (Updater, CommandHandler, MessageHandler, Filters, ConversationHandler)
import logging
import fanfou
import json
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO)
logger = logging.getLogger(__name__)
consumer = {'key': 'your_key_here', 'secret': 'your_secret_here'}
@unisolate
unisolate / steam.py
Created January 5, 2017 17:09
Crawl app recommendation count from Steam
from __future__ import print_function
import urllib2
import json
import time
import sys
def eprint(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
url = "http://store.steampowered.com/api/appdetails/?appids="
@unisolate
unisolate / siri.md
Last active February 3, 2017 13:22
Available Siri commands

Commands in English

Conversion

What are 130 miles in yards ? What are 9000 meters in kilometers ? What are 41 liter in ounces ? What are 2 feet in miles ?

Convert 130 minutes to hours Convert 23 years to seconds Convert 8.4 hours to days

@unisolate
unisolate / build-vim.sh
Last active February 3, 2017 13:22
Build Vim from source
sudo apt-get install libncurses5-dev libgnome2-dev libgnomeui-dev \
libgtk2.0-dev libatk1.0-dev libbonoboui2-dev \
libcairo2-dev libx11-dev libxpm-dev libxt-dev python-dev \
python3-dev ruby-dev lua5.1 lua5.1-dev libperl-dev git
sudo apt-get remove vim vim-runtime gvim
sudo apt-get remove vim-tiny vim-common vim-gui-common vim-nox
cd ~
git clone https://github.com/vim/vim.git
cd vim
./configure --with-features=huge \
@unisolate
unisolate / 2bit.sh
Created March 28, 2016 11:14
twoBitToFa
# hg19.fa 是指 hg19的fasta文件。
# 它是很重要的参考文件,像bedtools,bowtie,bwa等,都需要它。
# 一般来说,使用的都是UCSC的hg19文件作为权威的。地址是:
# http://hgdownload.cse.ucsc.edu/downloads.html#human
# 然后下载
# http://hgdownload.cse.ucsc.edu/goldenPath/hg19/bigZips/
# 中的 hg19.2bit
@unisolate
unisolate / font-family.txt
Last active August 28, 2015 12:57
font-family
"Helvetica Neue",Helvetica,"Nimbus Sans L", Arial,"Liberation Sans","PingFang SC","Hiragino Sans GB","Source Han Sans CN","Source Han Sans SC","Microsoft YaHei","Wenquanyi Micro Hei","WenQuanYi Zen Hei","ST Heiti",SimHei,"WenQuanYi Zen Hei Sharp",sans-serif
Baskerville,Georgia,"Liberation Serif","Kaiti SC",STKaiti,"AR PL UKai CN","AR PL UKai HK","AR PL UKai TW","AR PL UKai TW MBE","AR PL KaitiM GB",KaiTi,KaiTi_GB2312,"TW\-Kai",serif
Menlo,Monaco,Consolas,"Bitstream Vera Sans Mono","Courier New",Courier,monospace