This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from bs4 import BeautifulSoup as bs | |
from itertools import chain, filterfalse | |
langs = {'python': ['(py)', '(pypy)', '(py3)'], | |
'ruby': ['(rb)']} | |
def get_pids(maxpage=17): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def SMQT(data, level): | |
ret = [0] * len(data) | |
def MQU(idx, depth): | |
if depth == 0 or not idx: | |
return | |
mean = sum(data[i] for i in idx) / len(idx) | |
D0, D1 = [], [] | |
for i in idx: | |
(D0 if data[i] <= mean else D1).append(i) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
layout = [ | |
["","","","","","","","","","","","","","",""], | |
[{w:1.5},"","","","","","","","","","","","","",{w:1.5},""], | |
[{w:1.75},"","","","","","","","","","","","",{w:2.25},""], | |
[{w:2.25},"","","","","","","","","","","",{w:1.75},"",""], | |
[{x:1.5},"",{w:1.5},"",{w:6},"",{w:1.5},"",""] | |
]; | |
split_pos = [ | |
[5, 4.5, 4.75, 4.25, 4.75], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/utf8.c b/utf8.c | |
index ad99edc..0d803d3 100644 | |
--- a/utf8.c | |
+++ b/utf8.c | |
@@ -343,7 +343,200 @@ static struct utf8_width_entry utf8_width_table[] = { | |
{ 0xe0100, 0xe01ef, 0, NULL, NULL }, | |
{ 0x100000, 0x10fffd, 0, NULL, NULL }, | |
}; | |
+ | |
+/* Sorted, generated by 'uniset +WIDTH-A +WIDTH-F +WIDTH-W -cat=Me -cat=Mn -cat=Cf c' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" auto reset input method | |
function! g:SetImeToEnglish() | |
let s:current_input_method = system("ibus engine") | |
if s:current_input_method !~ "xkb:us::eng" | |
let s:ret = system("ibus engine xkb:us::eng") | |
endif | |
endfunction | |
let s:ibus_version = system("ibus version") | |
if s:ibus_version =~ "IBus 1.5" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Plots race TypeRacer history. | |
Make sure you have permission to read the file | |
usage: | |
$ python3 race_plot.py race_data.csv [day, week, month or year] | |
""" | |
import sys | |
import matplotlib.pyplot as plt | |
import pandas as pd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from mecode import GMatrix | |
import numpy as np | |
e = 0.00001 | |
inch = 25.4 | |
unit = 19.05 | |
feedrate = 200 | |
tool_diameter = 1 | |
overlap = 0.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BUILDDIR = build | |
SRCDIR = src | |
OPENSCAD:=$(shell type -p openscad || echo /Applications/OpenSCAD.app/Contents/MacOS/OpenSCAD) | |
VPATH = $(SRCDIR):$(BUILDDIR) | |
STL_TARGETS = $(patsubst $(SRCDIR)/%.scad,$(BUILDDIR)/%.stl,$(wildcard $(SRCDIR)/*.scad)) | |
.PHONY: all clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import matplotlib.pyplot as plt | |
import pandas as pd | |
from matplotlib import cm | |
from datetime import datetime, timezone, timedelta | |
plt.style.use('ggplot') | |
ticks_format = { | |
'day': '%b, %-d', | |
'week': '%b, %-d', | |
'month': '%b', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import httplib2 | |
import pandas as pd | |
import simplejson as json | |
from datetime import datetime | |
from datetime import timedelta | |
def get_trade_history_(currency_pair='USDT_BTC', start=1494000000, end=1600000000): | |
""" | |
Simply query trade history in given range |
OlderNewer