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 os import chdir, system | |
| from urllib.request import urlretrieve | |
| from subprocess import run, DEVNULL | |
| try: | |
| hello_world() | |
| except NameError: | |
| run("rm -rf cpython-3.13.2.zip".split(), stdout=DEVNULL, stderr=DEVNULL) | |
| run("rm -rf cpython-3.13.2".split(), stdout=DEVNULL, stderr=DEVNULL) | |
| urlretrieve("https://github.com/python/cpython/archive/refs/tags/v3.13.2.zip", "cpython-3.13.2.zip") |
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 ipaddress | |
| import requests | |
| import re | |
| import socket | |
| import sys | |
| import multiprocessing.pool | |
| def scan(ip): | |
| print(f"* Scanning {ip}") | |
| try: |
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
| """ | |
| Solved for https://mic.hael.xyz/cbc-noauth | |
| """ | |
| def xor(b1, b2): | |
| if len(b1) != len(b2): | |
| raise TypeError() | |
| return bytes(b1[i] ^ b2[i] for i in range(len(b1))) |
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 random | |
| answers = ["It is certain", "It is decidedly so", "Without a doubt", | |
| "Yes definitely", "You may rely on it", "As I see it, yes", | |
| "Most likely", "Outlook good", "Yes", "Signs point to yes", | |
| "Reply hazy, try again", "Ask again later", | |
| "Better not tell you now", "Cannot predict now", | |
| "Concentrate and ask again", "Don’t count on it", "My reply is no", | |
| "My sources say no", "Outlook not so good", "Very doubtful"] |
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
| //compile:gcc -Wall -Wextra -Werror -pedantic -O3 $(pkg-config --cflags --libs | |
| // libusb-1.0) -o $A0 $SRC | |
| //dev:gcc -Wall -Wextra -Werror -pedantic -fsanitize=address | |
| // -fsanitize=undefined -g $(pkg-config --cflags --libs libusb-1.0) -o $A0 $SRC | |
| #include <libusb.h> | |
| #include <stdio.h> | |
| #include <unistd.h> | |
| // this may need to be changed depending on your controller |
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
| """ | |
| wiki_reader.py - Crude script to read a wikipedia article from an offset and an article ID | |
| To find an article ID, use bzgrep on | |
| enwiki-latest-pages-articles-multistream-index.txt.bz2 | |
| For example (in my shell *index* expands to enwiki-latest-pages-articles-multistream-index.txt.bz2): | |
| bzgrep "Python (programming language)" *index* | |
| Requires the bzip2 compressed dumps of Wikipedia. Download | |
| enwiki-latest-pages-articles-multistream-index.txt.bz2 and |
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
| {"ZPDQ":{"airportCodeIata":"DIG","airportName":"Deqen Shangri-La Arpt","cityName":"Deqen","cityType":"International","countryCode":"CN","region":"","meta":{"icaoCode":"ZPDQ","iataCode":"DIG","latitudeDegreeNum":27.7936000824,"longitudeDegreeNum":99.6772003174,"timeZoneDesc":"Asia/Shanghai"}},"KSGF":{"airportCodeIata":"SGF","airportName":"Springfield-Branson Rg","cityName":"Springfield","cityType":"Domestic","countryCode":"US","region":"MO","meta":{"icaoCode":"KSGF","iataCode":"SGF","latitudeDegreeNum":37.24570084,"longitudeDegreeNum":-93.38860321,"timeZoneDesc":"America/Chicago"}},"KFOE":{"airportCodeIata": "FOE","airportName":"Forbes Field","cityName":"Forbes Field","cityType":"Domestic","countryCode":"US","region":"United States","meta":{"icaoCode":"KFOE","iataCode":"FOE","latitudeDegreeNum":37.24570084,"longitudeDegreeNum":-93.38860321,"timeZoneDesc":"America/Chicago"}},"KBED":{"airportCodeIata":"BED","airportName":"Laurence G. Hanscom Field","cityName":"Laurence G. Hanscom Field","cityType":"Domestic","co |
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 struct import pack | |
| # WAV format reference: http://soundfile.sapp.org/doc/WaveFormat/ | |
| # one period of a sine wave in 8 samples | |
| beep = bytes([0x80, 0xd9, 0xff, 0xd9, 0x80, 0x26, 0x01, 0x26]) * 80 | |
| # one period of silence | |
| sil = bytes([80] * 8) * 80 | |
| # morse code |
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 Explain XKCD shortcut | |
| // @namespace http://tampermonkey.net/ | |
| // @version 0.1 | |
| // @description Shows link to Explain XKCD on xkcd.com | |
| // @author michaelfm1211 | |
| // @match https://xkcd.com/* | |
| // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== | |
| // @grant none | |
| // ==/UserScript== |
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 PIL import Image | |
| from math import ceil | |
| # these variables are not used everywhere and some parts just assume that they are both (100, 100). | |
| # change at your own risk. | |
| scale = (100, 100) | |
| res = (100, 100) | |
NewerOlder