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
// ==UserScript== | |
// @name Remove Custom Subreddit Themes | |
// @namespace http://aaronholmes.net/ | |
// @version 0.1 | |
// @description Remove custom subreddit themes from every subreddit | |
// @author Aaron Holmes | |
// @match https://www.reddit.com/r/* | |
// @grant none | |
// ==/UserScript== | |
/* jshint -W097 */ |
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
using System; | |
using System.Diagnostics; | |
using System.Linq; | |
namespace ConsoleApplication3 | |
{ | |
class Program | |
{ | |
static int add(int x , int 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
using System; | |
using System.Diagnostics; | |
using System.IO; | |
using System.Threading.Tasks; | |
namespace AsyncPerf | |
{ | |
class Program | |
{ | |
const int MAXRUNS = 10000000; |
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
/* | |
Scroll all the way down on https://robinhood.com/account/history?type=orders | |
Paste this into the dev console | |
`totals` holds your overall cost basis for each position you've held | |
Do note that this is just a quick bang out and likely isn't 100% correct | |
*/ | |
const headers = Array.from(document.querySelectorAll('[data-testid="rh-ExpandableItem-buttonContent"]')).map(e => e.querySelectorAll('h3, h3 ~ span')) | |
const action_regex = /(.+?) (Market|(Stop )?Limit|(\$\d+ (Call|Put) (\d+\/\d+\/\d+))) (Buy|Sell)/ |
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 os | |
import threading | |
from multiprocessing import Pool | |
from atexit import register | |
from sys import exit | |
from typing import Union | |
@register | |
def term(): | |
print("TERM!") |
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 math import trunc | |
from struct import pack | |
from typing import List | |
from random import random | |
def main(): | |
# some hard-coded image attributes | |
# the width and height are 50 pixels | |
img_width = 50 |
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
void Main() | |
{ | |
var file = @"path to file"; | |
var sw = new Stopwatch(); | |
sw.Start(); | |
var fileContent = File.ReadAllText(file); | |
sw.Stop(); | |
Console.WriteLine($"Time to read file: {sw.Elapsed.TotalMilliseconds}ms"); | |
const int iterations = 10000; |
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 cProfile | |
from functools import wraps | |
from logging import Logger | |
from random import choice | |
from string import ascii_letters | |
from typing import TYPE_CHECKING | |
if TYPE_CHECKING: | |
from typing import Any, Callable |
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
namespace aholmes.Writer | |
{ | |
/// <summary> | |
/// Wraps System.Console | |
/// </summary> | |
public class ConsoleWrapper : IConsole | |
{ | |
/// <inheritdoc/> | |
public void Write(string value) => Console.Write(value); | |
/// <inheritdoc/> |