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
newton~ <3 bc -l | |
bc 1.06.95 | |
Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc. | |
This is free software with ABSOLUTELY NO WARRANTY. | |
For details type `warranty'. | |
# thanks to matti for this | |
*1 | |
(standard_in) 1: syntax error | |
*1 | |
1 |
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
// compile with $ gcc -o test.so -shared test.c | |
int fnord(int a, int b){ | |
return a+4*b-1; | |
} |
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 ctypes as ct | |
lua = ct.CDLL('liblua.so.5.2') | |
lua.luaL_newstate.restype = ct.c_void_p | |
lua.lua_tolstring.restype = ct.c_char_p | |
st = lua.luaL_newstate() | |
def foo(st): | |
print(lua.lua_tolstring(st, 1, 0).value.decode()) |
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
/* | |
* Copyright (c) 1997-2006 Motoyuki Kasahara | |
* | |
* Redistribution and use in source and binary forms, with or without | |
* modification, are permitted provided that the following conditions | |
* are met: | |
* 1. Redistributions of source code must retain the above copyright | |
* notice, this list of conditions and the following disclaimer. | |
* 2. Redistributions in binary form must reproduce the above copyright | |
* notice, this list of conditions and the following disclaimer in the |
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
newton~/d/z/Src <3 egrep -in 'mod_export.*;' **.c|wc -l | |
191 |
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
# The following command will give you a list of BBC streams that can be accessed from anywhere since BBC only does their geoIP filtering on access of the stream *playlist*, not on access of the stream itself. | |
curl -sx http://[INSERT UK HTTP PROXY HERE]/ 'http://www.bbc.co.uk/radio/listen/live/r3_aaclca.pls'|egrep -o 'http://.*$' | |
# Low-bitrate international stream URLs look like this: | |
# http://bbcmedia.ic.llnwd.net/stream/bbcmedia_intl_lc_radio3_q?foobarbaz | |
# Notice the "intl" there. | |
# High-bitrate domestic stream URLs look like this: | |
# http://bbcmedia.ic.llnwd.net/stream/bbcmedia_lc1_radio3_p?foobarbaz | |
# Notice the lack of "intl" there. |
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 ctypes import * | |
import threading | |
import os | |
import asyncio | |
# vim: ts=4 sw=4 | |
backend = CDLL('libmpv.so') |
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
newton~ <3 ipython3 | |
Python 3.4.1 (default, May 19 2014, 17:23:49) | |
Type "copyright", "credits" or "license" for more information. | |
IPython 2.1.0 -- An enhanced Interactive Python. | |
? -> Introduction and overview of IPython's features. | |
%quickref -> Quick reference. | |
help -> Python's own help system. | |
object? -> Details about 'object', use 'object??' for extra details. |
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
#!/usr/bin/env python | |
import time | |
import bs4 | |
import requests | |
def log(*args): | |
print(time.strftime('\x1B[93m[%m-%d %H:%M:%S]\x1B[0m'), *args+('\x1B[0m',)) | |
def logon(res): |
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
#!/usr/bin/env python3 | |
import numpy as np | |
from math import sin, cos, pi, sqrt | |
import svgwrite | |
import itertools | |
def cam(f): | |
""" Returns a camera matrix for the given focal length """ | |
return np.array(((1,0,0,0), | |
(0,1,0,0), |