This file contains hidden or 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 quick and dirty javascript to paste in devtools (F12 in browser) console to remove client-side paywalls | |
| After running, you'll have a "hide" button you can press to get rid of the currently displayed paywall/overlay. | |
| You may need to press it several times. | |
| You'll also have a "close" button to hide the buttons. | |
| If you want to use on Android/Chrome, you can! Use the following abbreviated version. Add as a bookmark | |
| (will have to manually re-add the "javascript: " at the front) then launch by typing the name of the bookmark | |
| in the address bar and pressing on it (clicking from the bookmark section does not work). I named my bookmark |
This file contains hidden or 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 selenium import webdriver | |
| from selenium.common.exceptions import ElementNotInteractableException | |
| from selenium.webdriver.common.action_chains import ActionChains | |
| from selenium.webdriver.remote.webelement import WebElement | |
| from selenium.webdriver.support.wait import WebDriverWait | |
| from selenium.webdriver.support import expected_conditions | |
| from selenium.webdriver.common.keys import Keys | |
| import csv | |
| driver = webdriver.Chrome() |
This file contains hidden or 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
| .minCal { | |
| display: inline-table; | |
| padding: 0.5em; | |
| text-align: center; | |
| width: 100%; | |
| border: 1px solid black; | |
| padding: 0; | |
| background-color:white; | |
| color: black; | |
| } |
This file contains hidden or 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
| /* | |
| Quick and dirty way to see raw requests made, for debugging. | |
| */ | |
| import java.net.ServerSocket | |
| def server = new ServerSocket(4444) | |
| while(true) { | |
| server.accept { socket -> | |
| socket.withStreams { input, output -> | |
| byte[] buf = new byte[256] |
This file contains hidden or 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 com.sun.net.httpserver.HttpServer | |
| HttpServer.create(new InetSocketAddress(8899), 0).with { | |
| createContext("/") { http -> | |
| http.with { | |
| println (requestMethod + " " + requestURI + " HTTP/1.1") | |
| requestHeaders.each{ | |
| a,b -> b.each{ | |
| y -> println a + ": " + y | |
| } |
This file contains hidden or 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/env python | |
| import sys | |
| import string | |
| while True: | |
| b = sys.stdin.read(16) | |
| if not b: | |
| break | |
| print "".join(map(lambda x: "%02x " % x, map(ord, b))) + " " + "".join(map(lambda x: x if x in string.printable else chr(0xA7), b)).replace('\t',' ') |
This file contains hidden or 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
| """ | |
| Looking for a way to reduce a list of 9 digits into a sum that is unique if the digits are those between 1 and 9 inclusively. | |
| This is for a solution to a Sudoku problem, but it was fun to mess around with functional programming. | |
| """ | |
| import itertools, functools, inspect | |
| def findAllSimilar(individualOperation, aggregationOperation): | |
| # Note: doing range inverse to make sure operation is commutative | |
| expected = functools.reduce(aggregationOperation, map(individualOperation, range(9, 0, -1))) |
This file contains hidden or 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 node | |
| var tty = require('tty') | |
| var readline = require('readline') | |
| var util = require('util') | |
| // Config | |
| var keyBindings = { | |
| "C-x": "quit", | |
| "C-r": "draw-screen", |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Date select copy</title> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.17.1/moment.min.js"></script> | |
| <script type="text/javascript"> | |
| if (typeof($) == "undefined") { | |
| $ = document.getElementById.bind(document); | |
| } |
This file contains hidden or 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
| /* | |
| * Finds locations within data structure that a specific key/value can be found | |
| * - Handles looping data structures (for instance window.window = window) | |
| * - Flexible query format (provide key to match, value to match, or both) | |
| * - Handy for reverse engineering and understanding javascript code on websites | |
| * - Note, it's a little hack-ish, but it's just a tool anyway | |
| * Examples: | |
| * a = {b: 4, c: [1, 2, {d: 5, e: [0, 5, 2]}]}; | |
| * searchObj(a, {key: d}); // --> ["root.c.2.d"] | |
| * searchObj(a, {value: 2}); // --> ["root.c.1", "root.c.2.e.2"] |