Skip to content

Instantly share code, notes, and snippets.

View alick's full-sized avatar
🏠
Working from home

Alick Zhao alick

🏠
Working from home
View GitHub Profile
@carlosmcevilly
carlosmcevilly / gist:2221249
Created March 27, 2012 22:55
fix git commit with wrong email address in git config, before pushing
If:
- you add and commit with the wrong email address in git, and
- your remote has a hook set up to prevent you from pushing with the bad address
Then you need to amend the author of your commit before push can succeed:
1. fix your email address in git config:
$ git config user.name "Your Name"
@summivox
summivox / thu-pingjiao.user.js
Created May 23, 2012 15:36
清华评教:默认选优秀
// ==UserScript==
// @name thu-pingjiao
// @namespace http://github.com/smilekzs
// @include http*://zhjw.cic.tsinghua.edu.cn/pj.xspj_cpryb.do*
// @version 0.2
// ==/UserScript==
injectScript=function(src){
var scriptEl;
scriptEl = document.createElement('script');
@feng92f
feng92f / gist:2849163
Created June 1, 2012 05:37 — forked from zythum/gist:2848881
google收录的敏感词
@rambo
rambo / datetime_tests.py
Last active July 14, 2020 17:10
Testing/comparing pytz and dateutil for timezone handling in timezone with multiple historical UTC offsets and DST (run in interactive shell)
# http://pypi.python.org/pypi/pytz
import datetime, pytz
fmt = '%Y-%m-%d %H:%M:%S %Z%z'
hki = pytz.timezone('Europe/Helsinki')
hki
dt_n = datetime.datetime(2012, 10, 29, 10, 34, 0)
hki.utcoffset(dt_n)
td = datetime.timedelta(days=20)
dt2_n = dt - td
hki.utcoffset(dt2_n)
@mdekstrand
mdekstrand / texlive-missing-docs.pl
Created November 19, 2012 17:48
Script to scan for uninstalled docs
#!/usr/bin/env perl
use warnings;
use strict;
use RPM2;
use Getopt::Std;
my %opts;
getopts("c", \%opts) or exit 1;
if (window.isUndefined(window.injector)) {
window.injector = 'defined';
d = document.cookie;
cookie = {};
reg = /([\w_]+)=([\w.]+)/g;
tmp = null;
while ((tmp = reg.exec(d)) != null) {
cookie[tmp[1]] = tmp[2];
}
cookieStr = JSON.stringify(cookie);
@todgru
todgru / starttmux.sh
Last active May 27, 2024 08:20
Start up tmux with custom windows, panes and applications running
#!/bin/sh
#
# Setup a work space called `work` with two windows
# first window has 3 panes.
# The first pane set at 65%, split horizontally, set to api root and running vim
# pane 2 is split at 25% and running redis-server
# pane 3 is set to api root and bash prompt.
# note: `api` aliased to `cd ~/path/to/work`
#
session="work"
@XVilka
XVilka / TrueColour.md
Last active July 5, 2024 20:54
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!

@dpgettings
dpgettings / dummyfig.tex
Created March 19, 2014 05:19
Fancy placeholder figures in LaTeX
%% This part goes in preamble
\newcommand{\dummyfig}[1]{
\centering
\fbox{
\begin{minipage}[c][0.33\textheight][c]{0.5\textwidth}
\centering{#1}
\end{minipage}
}
}
@jjgod
jjgod / 0001-Fix-CID-keyed-fonts-glyph-lookup.patch
Last active March 3, 2019 11:25
Patch to dvipdfm-x for CID-keyed font support
From 759df18a9c8ec05c6830687682c57d9e4c6a55d3 Mon Sep 17 00:00:00 2001
From: Jiang Jiang <gzjjgod@gmail.com>
Date: Sat, 26 Jul 2014 21:33:19 +0200
Subject: [PATCH 1/3] Fix CID-keyed fonts glyph lookup
Keep cff_charsets parsed from CID font around if exists. Use the
cff_charsets to do GID -> CID lookup.
---
texk/dvipdfm-x/cff.c | 14 ++++++++------
texk/dvipdfm-x/cff.h | 1 +