Skip to content

Instantly share code, notes, and snippets.

View Hootrix's full-sized avatar
💭
I may be slow to respond.

Pang Hootrix

💭
I may be slow to respond.
View GitHub Profile
@Hootrix
Hootrix / who_data.py
Last active August 17, 2019 08:07 — forked from HintikkaKimmo/who_data.py
handy way to read csv files with unknown csv dialect
import csv
import pprint
# opens csv file and assingns it to an object
with open('data-text.csv') as csvfile:
# Use Sniffer to figure out csv dialect
dialect = csv.Sniffer().sniff(csvfile.read(1024))
csvfile.seek(0)
# pass the dialect to filereader to read the file
reader = csv.reader(csvfile, dialect)
@Hootrix
Hootrix / mtr.css
Created March 21, 2019 05:10 — forked from ruanyf/mtr.css
mtr.css: Hong Kong MTR station colors http://metrocolor.live/index.html
:root {
--heng-fa-chuen: #b51921;
--tai-koo: #b2103e;
--kowloon-bay: #c41832;
--tseung-kwan-o: #ef342a;
--wui-kai-sha: #a84d18;
--po-lam: #f68f26;
--sai-wan-ho: #faca07;
--disneyland-resort: #07594a;
--skek-kip-mei: #4ba946;
@Hootrix
Hootrix / gist:20245a578b34814193e6b58a71ff36f4
Created December 19, 2018 06:26 — forked from codler/gist:3906826
Support HTTP Header Range, mp4, php.php/mp4.mp4
<?php
# Nginx don't have PATH_INFO
if (!isset($_SERVER['PATH_INFO'])) {
$_SERVER['PATH_INFO'] = substr($_SERVER["ORIG_SCRIPT_FILENAME"], strlen($_SERVER["SCRIPT_FILENAME"]));
}
$request = substr($_SERVER['PATH_INFO'], 1);
$file = $request;
$fp = @fopen($file, 'rb');