Skip to content

Instantly share code, notes, and snippets.

View gonghao's full-sized avatar
😂
Nothing

Howtin gonghao

😂
Nothing
View GitHub Profile
@gonghao
gonghao / upgrade.sh
Last active July 14, 2020 17:17
Upgrade python in venv
#export EXISTING_ENV_PATH="~/Sites/data/py-envs/crucio/"
cd $EXISTING_ENV_PATH
rm -f .Python
rm -f bin/pip{,3*}
rm -f bin/python{,3*}
rm -rf include/python3*
rm -f lib/python3*/*
rm -rf lib/python3*/distutils
rm -f lib/python3*/site-packages/easy_install.*
@gonghao
gonghao / install_pycurl.sh
Created September 27, 2017 06:49
pycurl: libcurl link-time ssl backend (openssl) is different from compile-time ssl backend (none/other)
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"
export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig"
export PYCURL_SSL_LIBRARY=openssl
pip install pycurl --compile pycurl --no-cache
@gonghao
gonghao / xxf.zsh-theme
Last active June 22, 2017 10:43 — forked from xfanwu/xxf.zsh-theme
Yet another theme for oh-my-zsh
# Copy and self modified from ys.zsh-theme, the one of default themes in master repository
# Clean, simple, compatible and meaningful.
# Tested on Linux, Unix and Windows under ANSI colors.
# It is recommended to use with a dark background and the font Inconsolata.
# Colors: black, red, green, yellow, *blue, magenta, cyan, and white.
# http://xiaofan.at
# 2 Jul 2015 - Xiaofan
# Machine name.
function box_name {
<?xml version="1.0" encoding="UTF-8"?>
<Update_Wizard VIN="xxx">
<m module="AWD">
<d DID="F110" Desc="On-line Diagnostic Database Reference Number" Data=""/>
<d DID="F111" Desc="ECU Core Assembly Number" Data=""/>
<d DID="F113" Desc="ECU Delivery Assembly Number" Data=""/>
<d DID="F124" Desc="ECU Calibration Data #1 Number" Data=""/>
<d DID="F162" Desc="Software Download Specification Version" Data=""/>
<d DID="F163" Desc="Diagnostic Specification Version" Data=""/>
<d DID="F188" Desc="Vehicle Manufacturer ECU Software Number" Data=""/>
@gonghao
gonghao / lazy_var.swift
Created September 10, 2016 16:29
Customize lazy variable
private lazy var detailLabel:UILabel = {
let label = UILabel()
label.textColor = UIColor.blackColor()
label.font = UIFont(name: “KannadaSangamMN”, size: 14.0)
self.addSubview(label)
return label
}()
@gonghao
gonghao / dabblet.css
Created July 10, 2015 03:44
Untitled
.banner { width: 300px; height: 200px; overflow: hidden; position: relative; }
.banner > a { position: absolute; top: -100%; bottom: -100%; left: -100%; right: -100%; text-align: center; }
.banner > a:before { content: ""; display: inline-block; vertical-align: middle; height: 100%; }
.banner > a > img { vertical-align: middle; }
.banner:after { content:""; position: absolute; top: 0; left: 0; bottom: 0; right: 0; background: rgba(0, 0, 0, 0.3); }
@gonghao
gonghao / dabblet.css
Last active August 29, 2015 14:20
Untitled
.banner { width: 300px; height: 200px; overflow: hidden; position: relative; }
.banner > a { position: absolute; top: -100%; bottom: -100%; left: -100%; right: -100%; text-align: center; }
.banner > a:before { content: ""; display: inline-block; vertical-align: middle; height: 100%; }
.banner > a > img { vertical-align: middle; }
@gonghao
gonghao / dabblet.css
Created April 30, 2015 09:25
Untitled
div { overflow-y: hidden; overflow-x: scroll; -webkit-overflow-scrolling: touch; width: 150px; border: 1px solid grey; } h1 { width: 400px; }
@gonghao
gonghao / dabblet.css
Created April 1, 2015 09:00
Untitled
div { overflow-y: hidden; overflow-x: scroll; -webkit-overflow-scrolling: touch; width: 100%; border: 1px solid grey; } h1 { width: 10000px; }
@gonghao
gonghao / dabblet.css
Created April 1, 2015 08:58
Untitled
div { overflow-y: hidden; overflow-x: scroll; -webkit-overflow-scrolling: touch; width: 150px; border: 1px solid grey; } h1 { width: 400px; }