Skip to content

Instantly share code, notes, and snippets.

(function(){
var nodes=document.body.getElementsByTagName('*');
for (var i=0; i<nodes.length; i++) {
if (nodes[i].style) {
cs = getComputedStyle(nodes[i]);
if (cs.textAlign == "left" || cs.textAlign == "start") {
nodes[i].style.textAlign = "justify";
}
}
}
@arpruss
arpruss / serif.js
Last active May 22, 2021 23:34
Times New Roman
(function(){
var nodes=document.body.getElementsByTagName('*');
for (var i=0; i<nodes.length; i++) {
if (nodes[i].style) nodes[i].style.fontFamily="Georgia, Utopia, \"Palatino Linotype\", Palatino, serif";
}
})()
@arpruss
arpruss / contrast.js
Last active June 8, 2021 14:44
increase page contrast
(function(){
function getColor(tag) {
m = tag.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);
if ( m )
return [parseInt(m[1]),parseInt(m[2]),parseInt(m[3]),255];
m = tag.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);
return m ? [parseInt(m[1]),parseInt(m[2]),parseInt(m[3]),parseInt(m[4])] : null;
}
function realBackgroundColor(elem) {
from time import time
import sys
import random
players = ["A","M","R"]
random.shuffle(players)
decode1 = [ (0,1,2), (0,2,1), (1,0,2), (1,2,0), (2,0,1), (2,1,0) ]
serves = [ 0 for i in range(3*6) ]
singles = [ 2 for i in range(6) ] + [ 0 for i in range(6) ] + [ 2 for i in range(6) ]
@arpruss
arpruss / flashfixinstant.py
Last active January 23, 2021 15:33
Run chromium/chrome while adding URLs to mms.cfg
import re
import os
import sys
from subprocess import Popen, PIPE, DEVNULL
import threading
CHROME = sys.argv[1]
DATA = sys.argv[2]
MMS_DIR = DATA + "/Default/Pepper Data/Shockwave Flash/System"
MMS = MMS_DIR + "/mms.cfg"
import re
with open("c:/chrome-with-flash-session/chrome_debug.log") as f:
with open("c:/chrome-with-flash-session/Default/Pepper Data/Shockwave Flash/System/mms.cfg", "a+") as out:
out.write("\n")
def add(url):
print(url)
out.write("AllowListUrlPattern="+url+"\n")
for line in f:
digits = """xxx
x.x
x.x
x.x
xxx
.x.
xx.
.x.
.x.
count = 1
def rev(x):
out = 0
for i in range(5):
out <<= 1
out |= x&1
x >>= 1
return out
TIA 0
TIY 0
zeroLoop:
AM
AIY 1
CIY F
JUMP zeroLoop
mainLoop:
TIA 1
TIY -1
#!/usr/bin/python
# based on : www.daniweb.com/code/snippet263775.html
import math
import wave
import struct
# Audio will contain a long list of samples (i.e. floating point numbers describing the
# waveform). If you were working with a very long sound you'd want to stream this to
# disk instead of buffering it all in memory list this. But most sounds will fit in
# memory.