Skip to content

Instantly share code, notes, and snippets.

View infinity0's full-sized avatar
🛠️
build bridges to the stars, not battleships and sports cars

Ximin Luo infinity0

🛠️
build bridges to the stars, not battleships and sports cars
View GitHub Profile
@infinity0
infinity0 / conf-partial.py
Created November 8, 2015 22:03
Sphinx LaTeX workarounds
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
'papersize': 'a4paper',
# The font size ('10pt', '11pt' or '12pt').
#'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
@infinity0
infinity0 / build-ghetto-deb-ocamleditor.sh
Created November 7, 2015 21:04
Build a ghetto binary debian package of OCamlEditor
#!/bin/sh
# Run this from a clone of:
# https://forge.ocamlcore.org/anonscm/git/ocamleditor/ocamleditor.git
set -e
VERSION="${VERSION:-1.13.2}"
git checkout $VERSION
git clean -fdx
@infinity0
infinity0 / test.py
Last active October 14, 2015 17:53
how to combine two x25519 private keys
#!/usr/bin/python3 -i
from nacl.bindings import *
from binascii import b2a_hex
BO = "little"
order_b = 2**252 + 27742317777372353535851937790883648493
order = 8 * order_b
@infinity0
infinity0 / rfc2822_to_iso8601.py
Created June 22, 2015 19:53
RFC2822 to ISO8601 date converter
#!/usr/bin/python
# RFC2822 to ISO8601 date converter, that doesn't require you to fuck with the TZ variable.
# Fuck the POSIX time functions.
import time, email.utils, sys
t = email.utils.parsedate_tz(sys.argv[1])
t, tz = t[:-1], t[-1]
print(time.strftime("%Y-%m-%dT%H:%M:%S", t) + "{0:+03d}{1:02d}".format(tz/3600, tz/60%60))
@infinity0
infinity0 / compat
Last active August 29, 2015 14:00
Stub debian packaging for ctlog
9
#!/usr/bin/python
#
# Usage:
#
# $ ./conception.py 1969-12-25
# searching for most recent event before 1969-04-03
# <li><a href="/wiki/April_1" title="April 1">April 1</a>
# &#226;&#8364;&#8220; The <a href="/wiki/Hawker_Siddeley_Harrier" title="Hawker Siddeley Harrier">Hawker Siddeley Harrier</a> enters
# service with the <a href="/wiki/Royal_Air_Force" title="Royal Air Force">Royal Air Force</a>.</li>
#