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 json,re,math,sys | |
import statistics | |
import matplotlib.pyplot as plt | |
# python3 6653.py < 6653.json | |
#or | |
# curl https://www.predictit.org/api/marketdata/markets/6653 | python3 6653.py | |
data = json.load(sys.stdin) |
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 fcntl | |
def modfl(fd, flags): | |
'''Adds all given positive flags to, and removes all given negative flags from, the given file descriptor''' | |
# e.g.: modfl(f, (+os.O_SYNC, -os.O_NONBLOCK)) | |
# would make f synchronous and blocking | |
#OR-in positive flags; NAND-out negative ones | |
ins = lambda fl, x: (fl | x) if x >= 0 else (fl &~ -x) | |
# 1. Get the current flag field |
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
a { | |
/* bruh why does Suki nerf this" */ | |
text-decoration: underline; | |
} | |
.entry-content p>code[class^='language-'], p>code[class*=' language-'] { | |
/* https://wordpress.stackexchange.com/q/380863/52811" */ | |
white-space: nowrap; | |
} |
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
Name: gtk-recordmydesktop | |
Version: 0.3.8 | |
Release: 1%{?dist} | |
Summary: GTK frontend for recordMyDesktop | |
License: GPLv2+ | |
URL: http://recordmydesktop.sourceforge.net/ | |
Source0: https://downloads.sourceforge.net/recordmydesktop/%{name}-%{version}.tar.gz | |
Patch0: gtk-recordmydesktop-shebang.patch |
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
<meta charset="UTF-8"> | |
<!-- <script src="http://www.myersdaily.org/joseph/javascript/md5.js" integrity="sha256-8tgc1DyxWwU+qElo1Jwd9aTZiU8H+y3QKZttyeCoIlg=" crossorigin="anonymous"/> --> | |
<script src="md5.js" integrity="sha256-8tgc1DyxWwU+qElo1Jwd9aTZiU8H+y3QKZttyeCoIlg="></script> | |
<script> | |
// aXMLHttpRequest: an asynchronous XHR function | |
function aXMLHttpRequest(method, location, responseType="", body=undefined) { | |
// somewhat basic; improvements welcome | |
return new Promise( (resolve, reject) => { | |
const xhr = new XMLHttpRequest(); |
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
asleep = (delay => new Promise(resolve => setTimeout(resolve, delay))); | |
aalert = ((message) => new Promise((resolve) => resolve(alert(message)))); | |
aconfirm = ((message) => new Promise((resolve) => resolve(confirm(message)))); | |
aprompt = ((message, deflt) => new Promise((resolve) => resolve(prompt(message, deflt)))); |
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
@echo OFF | |
rem TODO: testing on XP and 7 | |
rem TODO: robustness checking | |
rem YOU MUST EDIT THE 3 VARIABLES BELOW TO BE CORRECT: | |
set C_IFACE="Ethernet (1)" | |
set R_MAC="46-7f-2c-af-e2-2b" | |
set R_IP="192.168.0.1" | |
echo Current ARP entry for %R_IP% on "%C_IFACE%": | |
rem TODO: Should I remove the interface= flag and just show all entries? It might make troubleshooting easier in the event that there are some stale static entries stored after the user changes NICs |
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 random import random as r | |
#TODO: rewrite deterministically | |
def brier(pf=0.5, P=0.5, N=1024**2): | |
if callable(P): | |
o = P | |
elif hasattr(P, '__getitem__') | |
o = lambda t: P[t] | |
else: | |
o = lambda t: r()<P |
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 | |
# -*- coding: utf-8 -*- | |
from __future__ import division | |
import sys, os, stat, fcntl, subprocess, select, re | |
if sys.version_info < (3,): | |
from pipes import quote as shquote | |
else: | |
from shlex import quote as shquote | |
from functools import reduce, wraps | |
from itertools import repeat, starmap |
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
const DDG_ONION = browser.runtime.getManifest().permissions.find(p => | |
p.match(/duckduckgo.*\.onion/)); | |
const DDG_CLEARNET = browser.runtime.getManifest().permissions.find(p => | |
p.match(/duckduckgo(?!.*\.onion)/)) | |
const DDG_ONION_HOST = DDG_ONION.match(/^\*:\/\/(.+)\/\*$/)[1]; | |
function injectOnionHeader(details) { | |
let u = new URL(details.url); | |
let h = details.responseHeaders; | |
u.host = DDG_ONION_HOST; |