Skip to content

Instantly share code, notes, and snippets.

@git2358
git2358 / qd2fds.py
Created February 18, 2021 21:19 — forked from infval/qd2fds.py
Converts between QD and FDS disk images (Family Computer Disk System / Famicom)
#!/usr/bin/env python3
"""
Converts between QD and FDS disk images
"""
import struct
def create_fds_header(side_count):
return b"FDS\x1A" + bytes([side_count & 0xFF]) + bytes(11)
@git2358
git2358 / gist:32a24984e3cd95f98c484e0a22f49958
Created November 12, 2020 05:40
Uninstall XQuartz.app from OSX Yosemite/El Capitan/Sierra
launchctl unload /Library/LaunchAgents/org.macosforge.xquartz.startx.plist && \
sudo launchctl unload /Library/LaunchDaemons/org.macosforge.xquartz.privileged_startx.plist && \
sudo rm -rf /opt/X11* /Library/Launch*/org.macosforge.xquartz.* /Applications/Utilities/XQuartz.app /etc/*paths.d/*XQuartz && \
sudo pkgutil --forget org.macosforge.xquartz.pkg && \
rm -rf ~/.serverauth* && rm -rf ~/.Xauthorit* && rm -rf ~/.cache && rm -rf ~/.rnd && \
rm -rf ~/Library/Caches/org.macosforge.xquartz.X11 && rm -rf ~/Library/Logs/X11
@git2358
git2358 / tweetjam.md
Created October 11, 2020 12:30 — forked from kometbomb/tweetjam.md
PICO-8 tweetjam stuff

PICO-8 size optimization stuff

Here are some simple ways to make your PICO-8 code fit in 140 characters (as in the tweetjam craze). I did not invent these, I merely observed and collected them from the tweetjam thread.

LUA syntax stuff

  • Use single character variable names
  • Use x=.1 and x=.023, not x=0.1 or x=0.023
  • x=1/3 is shorter than x=.3333
  • You don't need to separate everything with spaces or write them on their own lines, e.g. circ(x,y,1)pset(z,q,7) works just as well
@git2358
git2358 / rgbHexes.pde
Created September 15, 2020 10:08 — forked from beesandbombs/rgbHexes.pde
RGB hexes
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {
if (p < 0.5)
return 0.5 * pow(2*p, g);
@git2358
git2358 / wayback.ps1
Created September 15, 2020 03:59 — forked from Beej126/wayback.ps1
Internet Archive (aka Wayback Machine) blog image recovery
# start with web archive's interactive search to hone in on the urls we need...
# e.g. https://web.archive.org/web/*/https://www.BeejBlog.com/wp-content/uploads//*
# viewing the ajax behind the search page (browser tools > network tab) we see the json feed for flat list of images & crucial wayback datestamp
# https://web.archive.org/cdx/search?url=https%3A%2F%2Fwww.BeejBlog.com%2Fwp-content%2Fuploads%2F%2F&matchType=prefix&collapse=urlkey&output=json&fl=original%2Ctimestamp%2Cendtimestamp
# click into the first search result and viewing the page source we see the format for direct image urls:
# e.g. https://web.archive.org/web/20160601110654if_/http://www.beejblog.com/wp-content/uploads/2008/08/204996604.jpg
# download the json list of our urls
@git2358
git2358 / parse_download.pl
Created September 7, 2020 03:12 — forked from isaaclw/parse_download.pl
Parse page (with perl) and then download everything matching a regex. #perl #download
#!/usr/bin/perl
# download a page, and then download all the files on the page according to the regular expression, and store them in the folder
use strict;
use URI::URL;
my $urlchars = "[^\'\"]";
parse("http://www.test.com/", "data-bt=\"($urlchars*?\.torrent)\"", "humble");
sub parse() {
@git2358
git2358 / p8.py
Created September 6, 2020 23:54 — forked from Ivoah/p8.py
Download all PICO-8 carts from lexaloffle BBS
from requests import get
from bs4 import BeautifulSoup
import re
import os
def make_filename(fname):
for c in ',! ().':
fname = fname.replace(c, '_')
while fname != fname.replace('__', '_'):
fname = fname.replace('__', '_')
@git2358
git2358 / README.md
Created September 1, 2020 03:02 — forked from hsandt/README.md
PICO8 0.1.11g and 0.1.12c skip intro patches for Linux 64-bit

Patches to skip the splashscreen and logo/version display when the PICO-8 editor starts. Intended for development purpose only.

Please check the thread: https://www.lexaloffle.com/bbs/?tid=3485. It contains instructions on how to reproduce the patch for different versions and OSes.

Download one of the patches below matching your PICO-8 version, then patch your binary.

At first I didn't manage to upload binaries as raw gists, so I pasted binary dumps instead so you could convert them back to binaries with xxd reverse dump operation xxd -r my.patch.txt > my.patch.

But I managed to upload the binaries by cloning the repo and pushing the new files back, so now both the dump and raw versions of the patches are available.

@git2358
git2358 / pico8_skip_0.1.6_linux32.bsdiff
Created August 30, 2020 06:24 — forked from josefnpat/pico8_skip_0.1.6_linux32.bsdiff
Pico8 0.1.6 Intro Skip for linux 64
@git2358
git2358 / The C64 Digi
Created August 28, 2020 02:10 — forked from munshkr/The C64 Digi
The C64 Digi ~ C=Hacking #20
<=============
The C64 Digi
=============> Robin Harbron <[email protected]>
Levente Harsfalvi <[email protected]>
Stephen Judd <[email protected]>
Introduction
------------
Digis -- digitally sampled audio -- are fairly common on the 64. This is