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 sys | |
| from dataclasses import dataclass | |
| from itertools import groupby | |
| from typing import List | |
| from tqdm import tqdm | |
| @dataclass | |
| class Run: |
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
| # Add the following code to ~/.bash_profile or ~/.bashrc | |
| function git_branch() { | |
| git rev-parse --abbrev-ref HEAD 2> /dev/null | |
| } | |
| function git_prompt() { | |
| local branch=$(git_branch) | |
| local deltas=$(git rev-list --left-right --count $branch...origin/$branch 2> /dev/null) | |
| local stats=$(git diff --stat 2> /dev/null | tail -n 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
| void main() | |
| { | |
| Hive ce = CreateHive(); | |
| if (ce) | |
| ce.InitOffline(); | |
| Weather weather = g_Game.GetWeather(); | |
| weather.GetOvercast().SetLimits(0.0, 1.0); | |
| weather.GetRain().SetLimits(0.0, 1.0); |
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
| .data | |
| fizz: .asciiz "Fizz" | |
| buzz: .asciiz "Buzz" | |
| line: .asciiz "\n" | |
| .text | |
| main: | |
| li $t0,0 | |
| li $t1,101 | |
| li $t2,3 |
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 python3 | |
| import re | |
| import sys | |
| import os | |
| import signal | |
| from typing import List | |
| from subprocess import call | |
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 python3 | |
| """ | |
| Automatically create a snapshot for a Vultr server, discarding old snapshots | |
| to keep only the newest N snapshots. | |
| Supports Python 3.6+. | |
| """ | |
| import logging |
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
| """Use genetic programming to reverse-engineer a truth table.""" | |
| import random | |
| import inspect | |
| import string | |
| from multiprocessing import Process, Value | |
| from deap import creator, base, tools, gp | |
| # 110 Automata | |
| # truth_table = [ |
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
| """Drexel Web Term Master Schedule scraper.""" | |
| import bs4 as bs | |
| import sqlite3 | |
| import requests | |
| from datetime import datetime | |
| def db_setup(conn): | |
| """Create the table and indices.""" |
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 typing import List, Callable, TypeVar, Optional | |
| T = TypeVar("T") | |
| def binary_search(l: List[T], key: Callable[[T], int]) -> Optional[T]: | |
| """Perform a binary search. | |
| Arguments |
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 json | |
| import requests | |
| import zlib | |
| from functools import wraps | |
| from urllib.parse import urlencode | |
| class ApiResponse: | |
| def __init__(self, response: dict): | |
| self.data = response['data'] |