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 csv | |
CSVFILE='2018H1.csv'# TL:DR: | |
#Spending money: | |
# -,Personal.Recreation.Social,28.37 | |
# -,Groceries,45.32 | |
#Getting money: | |
# +,Income.Job,420.69 | |
#Being subsidized: |
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
rotr = lambda v,n=1,s=8: ((v>>n)|(v<<(s-n)))&~(~0<<s) | |
rotl = lambda v,n=1,s=8: ((v<<n)|(v>>(s-n)))&~(~0<<s) | |
#rot*(number, number_of_bits_to_shift, size_of_number) | |
assert rotr(0b11110011,3) \ | |
== 0b01111110 | |
assert rotl(0xDEADBEEF,20,32) \ | |
== 0xEEFDEADB |
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
; append this FRAGMENT to gitea/custom/conf/app.ini | |
; NOTE: you must first run apt install python3-pip | |
; and python3 -m pip install docutils | |
; (if the latter is NOT run as root, be sure that ~/.local/bin is in PATH) | |
[markup.restructuredtext] | |
ENABLED = true | |
FILE_EXTENSIONS = .rst | |
RENDER_COMMAND = rst2html.py | |
IS_INPUT_FILE = false |
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
SET pythonfolder=%LocalAppData%\Programs\Python\Python37 | |
SET rst2odt="%pythonfolder%\Scripts\rst2odt.py" | |
SET msword="C:\Program Files\Microsoft Office\root\Office16\WINWORD.EXE" /t | |
SET flags=--strip-comments --report=none | |
%rst2odt% %flags% %1 "%~dpn1.odt" | |
REM TODO stackoverflow.com/q/13402898 | |
REM TODO stackoverflow.com/a/22194521 | |
start "" %msword% "%~dpn1.odt" |
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
decodeURIParam=p=>//<223 bytes w/o whitespace and comments | |
Object.assign(//Create a new object, | |
...//the union of the following objects: | |
p//location.parameters | |
.match(/^\??(.*)$/)//has a leading '?' | |
[1]//(which we don't want) | |
.split('&')//split the rest into '&'-delimited chunks, | |
.filter(S=>S)//remove null chunks (from duplicate or trailing ampersands) | |
.map(S=>S//take each chunk | |
.match(/^([^=]*)=?(.*)$/))//and split it via key=value |
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
#!/bin/sh | |
cd "$(dirname "${0}")/.." | |
case "${REQUEST_METHOD}" in | |
GET) | |
printf 'Status: %s\r\n' "200 OK" | |
printf 'Content-Type: %s\r\n' "application/json" | |
printf '\r\n' | |
exec cat "X.v0.json" |
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
# /etc/udev/rules.d/99-arduino.rules | |
SUBSYSTEM=="tty", ATTRS{manufacturer}=="*Arduino*", GROUP="james" |
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
#!/bin/sh | |
# cd ~/ssl;ln -vs csrs/*.csr www.csr | |
#cron: 0 0 1 * * "${HOME}/ssl/ncACMEutil.sh" renew www.csr | |
#CONFIG | |
cpanellogin=1234567#get this from the "Products" page | |
cd "${HOME}/ssl" | |
account_key="lec.key" | |
account_contact="mailto:webmaster@example.org" | |
webroot="${HOME}/public_html"#TODO: support different webroots per-domain |
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
#!/bin/sh | |
# ~/.local/bin/python3 | |
exec scl enable rh-python36 -- python3 "$@" |
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
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>GPS Trace 0.3</title> | |
<script src="http://www.ishygddt.xyz/~james/openlocationcode.min.js"></script> | |
<script src="http://www.ishygddt.xyz/~james/distVincenty.js"></script> | |
<script> | |
const softwareVersionString="My Apologies 20200805 - https://www.github.com/JamesTheAwesomeDude" |