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 tkinter import Tk, Entry, Frame, Label, StringVar | |
import struct | |
import traceback | |
def float_to_int(x): | |
s = struct.pack("d", x) | |
x = 0 | |
for value in s[::-1]: | |
x = (x << 8) | value | |
return x |
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 struct | |
import math | |
import decimal | |
from fractions import Fraction | |
def float_to_bits(f): | |
bits = [(b>>i)%2 for b in struct.pack(">d", f) for i in range(7, -1, -1)] | |
return "".join(str(b) for b in bits) | |
def bits_to_float(bits): |
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 math | |
class Point(object): | |
def __init__(self, *args, **kargs): | |
self.num_dimensions = kargs.get("num_dimensions", len(args)) | |
self.coords = [0 for i in range(self.num_dimensions)] | |
for i in range(len(args)): | |
self.coords[i] = args[i] | |
"""Gives the distance from this point to the origin.""" |
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
javascript:(function(){style = document.createElement("style"); style.stype = "text/css"; style.innerHTML = 'img[src$=".gif"]{filter: brightness(0%);} img[src$=".gif"]:hover{filter: brightness(100%);}'; document.getElementsByTagName("HEAD")[0].appendChild(style);})(); |
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 PIL import Image, ImageDraw | |
import sys | |
from io import BytesIO | |
from ctypes import memmove, windll, c_size_t as SIZE_T | |
from ctypes.wintypes import UINT, LPVOID, BOOL, HWND, HANDLE | |
HGLOBAL = HANDLE | |
GHND = 0x0042 | |
GMEM_SHARE = 0x2000 |
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
// ==UserScript== | |
// @name Emoticon Adder | |
// @version 1 | |
// @include http://chat.stackoverflow.com/rooms/* | |
// @include https://chat.stackoverflow.com/rooms/* | |
// @grant none | |
// ==/UserScript== | |
//note: emoticons with slash characters, for example ¯\_(ツ)_/¯, must be quadruple-escaped. Once for javascript, and again for markdown. | |
var choices = ["---", "(◕‿◕)", "(╯°□°)╯︵ ┻━┻", "( ͡° ͜ʖ ͡°)", "ಠ_ಠ", " ¯\\\\_(ツ)_/¯", "👍", "🐍"]; |
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
// ==UserScript== | |
// @name UnicodeEmojiAdder | |
// @version 6 | |
// @include http://chat.stackoverflow.com/rooms/* | |
// @include https://chat.stackoverflow.com/rooms/* | |
// @grant none | |
// ==/UserScript== | |
var style_template = ` | |
.boxPositioner{ |
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 requests | |
import base64 | |
import os | |
import pickle | |
import time | |
import re | |
import json | |
from bs4 import BeautifulSoup as BS | |
MIN_TIME_BETWEEN_REQUESTS = 10 |
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
// ==UserScript== | |
// @name char count adder (SO Chat) | |
// @namespace . | |
// @description Adds a label indicating the character count of your message | |
// @include http://chat.stackoverflow.com/rooms/* | |
// @include https://chat.stackoverflow.com/rooms/* | |
// @version 3 | |
// @grant none | |
// ==/UserScript== |
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
// ==UserScript== | |
// @name User Notes (SO Chat) | |
// @namespace . | |
// @include http://chat.stackoverflow.com/rooms/* | |
// @include https://chat.stackoverflow.com/rooms/* | |
// @version 2 | |
// @grant GM_getValue | |
// @grant GM_setValue | |
// ==/UserScript== |