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
Programming Language Checklist | |
by Colin McMillen, Jason Reed, and Elly Fong-Jones, 2011-10-10 | |
updated by BoppreH, 2024-01-24 | |
You appear to be advocating a new: | |
[ ] functional [ ] imperative [ ] object-oriented [ ] stack-based [ ] concurrent | |
[ ] interpreted [ ] compiled [ ] JIT [ ] cloud [ ] AI [ ] beginner-friendly | |
[ ] academic-friendly [ ] visual [ ] sharable [ ] esoteric | |
[ ] memory safe [ ] memory unsafe [ ] provable [ ] Turing-incomplete | |
[ ] statically-typed [ ] dynamically-typed [ ] completely incomprehensible |
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
""" | |
Login and visit each stackexchange site. Schedule it daily to win the Fanatic Badge after 100 days. | |
""" | |
# Create account.py module with 'email', 'password', and 'stackexchange_user_id'. | |
import account | |
import requests | |
import re | |
session = requests.Session() |
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 sys | |
from PIL import Image, ImageDraw | |
if len(sys.argv) > 1: | |
gif_path, = sys.argv[1:] | |
im = Image.open(gif_path) | |
width, before_height = im.size | |
images_before = [im.copy()] | |
while im.tell() < im.n_frames-1: | |
im.seek(im.tell()+1) |
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
class Proxy: | |
""" | |
Wraps an object to keep track of modifications, including to its children. | |
""" | |
def __init__(self, obj, modified_flag=None): | |
# Must use `super().__setattr__` to avoid recursing on itself. | |
super().__setattr__('_obj', obj) | |
super().__setattr__('_modified_flag', modified_flag or [False]) | |
@property |
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
# Python implementation of | |
# $ grep 'lasagna' beef.txt | sort -n | uniq | |
import re | |
lines = list(set(line for line in open('beef.txt') if 'lasagna' in line)) | |
lines.sort(key=lambda line: int(re.match('\d*', line)[0] or 0)) | |
for line in lines: print(line, end='') |
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
# Runs Grey Goo ascensions with no input required. Just run this script once a day and it'll do some basic farming (11-leaf clovers, eating fortune cookies, etc) and reincarnate in the same path when possible. | |
void do_jobs() { | |
# Spend time doing Jobs Boards adventures. Not very rewarding, but | |
# levels us up enough to cast daily skills and gives some pocket change. | |
if (my_adventures() >= 10) { | |
visit_url("place.php?whichplace=town&action=town_oddjobs"); | |
while (my_adventures() >= 10) { | |
run_choice(985, "pwd&option=3"); | |
} |
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
# Save to C:\Users\{USER}\AppData\Roaming\Mozilla\Firefox\Profiles\{PROFILE_NAME}\chrome\userContent.css | |
# And enable "toolkit.legacyUserProfileCustomizations.stylesheets" on about:config | |
@-moz-document domain(www.youtube.com) | |
{ | |
a:visited { | |
color: grey !important; | |
} | |
} |
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 subprocess | |
import collections | |
Interface = collections.namedtuple('Interface', 'name description subnet_mask ipv4_addresses ipv4_gateway ipv6_addresses ipv6_gateway dhcp_server dns_servers') | |
def parse_ipconfig(): | |
""" | |
Parses results from ipconfig. PowerShell has more structured functions, but | |
they don't serialize properly | |
(https://stackoverflow.com/questions/69997138/serialization-differences-between-powershells-format-list-and-convertto-json). |
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
def make(goal, book, pantry, costs): | |
def guess(steps, required_ingredients): | |
if all(pantry.count(ingredient) >= required_ingredients.count(ingredient) for ingredient in required_ingredients): | |
yield tuple(sorted(required_ingredients)), steps | |
for ingredient in set(required_ingredients) & set(book): | |
new_required_ingredients = required_ingredients + book[ingredient] | |
new_required_ingredients.remove(ingredient) | |
yield from guess([ingredient] + steps, new_required_ingredients) | |
yield from guess([goal], book[goal]) |
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 𝗫 = 1; | |
const 𝖷 = 0; | |
x = list => list.length | |
Array.prototype.ꭓ = Array.prototype.reduce | |
Array.prototype.ჯ = Array.prototype.slice | |
Array.prototype.X = Array.prototype.push | |
𝚇 = (𝕏) => { | |
𝚾 = [] |
NewerOlder