Skip to content

Instantly share code, notes, and snippets.

View Lunaphied's full-sized avatar

Lunaphied Lunaphied

View GitHub Profile
@ktemkin
ktemkin / default.nix
Last active March 10, 2023 19:12
scopehal derivation + dependencies
#
# scopehal apps, including glscopeclient and optionally ngscopeclient
#
# vim: et:ts=2:sw=2:
#
{ pkgs, lib, cmake, pkg-config, patchelf, ... }:
let
ffts = (pkgs.callPackage ./ffts.nix { });
vulkan-sdk = (pkgs.callPackage ./vulkan-sdk.nix { });
in
#!/usr/bin/python3
# Solution to the challenge at https://gist.github.com/ehmo/7f515ac6461c1c4d3e5a74f12e6eb5ea
# Sample solution: https://twitter.com/marcan42/status/1428933147660492800
#
# Given an input base image, computes two derivative images that have different
# perceptual hashes, yet differ by only one pixel.
#
# Usage: hash_bisector.py <input.png> <output_a.png> <output_b.png>
#
# Licensed under the terms of the STRONGEST PUBLIC LICENSE, Draft 1:
@akihikodaki
akihikodaki / README.en.md
Last active May 11, 2024 02:14
Linux Desktop on Apple Silicon in Practice

Linux Desktop on Apple Silicon in Practice

I bought M1 MacBook Air. It is the fastest computer I have, and I have been a GNOME/GNU/Linux user for long time. It is obvious conclusion that I need practical Linux desktop environment on Apple Silicon.

Fortunately, Linux already works on Apple Silicon/M1. But how practical is it?

  • Two native ports exist.
@cellularmitosis
cellularmitosis / README.md
Last active May 8, 2024 16:36
QEMU PowerPC G4 OS X Tiger (10.4) setup
###########################################################
# TX SX OS MIPS VM disassembler - by hexkyz and naehrwert #
###########################################################
import os
import re
import struct
host_calls_0 = {
0x8E943DA2 : "host_crc32 (ptr r4r5, len r6)",
@leoetlino
leoetlino / ios59_kernel.idc
Created May 18, 2018 20:34
IDC for the IOS59 kernel (Nintendo Wii)
This file has been truncated, but you can view the full file.
#define UNLOADED_FILE 1
#include <idc.idc>
static main(void)
{
// set 'loading idc file' mode
set_inf_attr(INF_GENFLAGS, INFFL_LOADIDC|get_inf_attr(INF_GENFLAGS));
GenInfo(); // various settings
Segments(); // segmentation
Enums(); // enumerations
@marcan
marcan / ghettohci.c
Created April 24, 2018 16:48
GhettOHCI - perhaps the world's smallest and stupidest OHCI stack.
/*
mini - a Free Software replacement for the Nintendo/BroadOn IOS.
ghettohci - debug over FT232 over OHCI
Copyright (C) 2012 Hector Martin "marcan" <marcan@marcansoft.com>
# This code is licensed to you under the terms of the GNU GPL, version 2;
# see file COPYING or http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
*/
@phiresky
phiresky / motioninterpolation.vpy
Last active April 11, 2024 00:36
Realtime motion interpolating 60fps playback in mpv
# vim: set ft=python:
# see the README at https://gist.github.com/phiresky/4bfcfbbd05b3c2ed8645
# source: https://github.com/mpv-player/mpv/issues/2149
# source: https://github.com/mpv-player/mpv/issues/566
# source: https://github.com/haasn/gentoo-conf/blob/nanodesu/home/nand/.mpv/filters/mvtools.vpy
import vapoursynth
core = vapoursynth.get_core()
@jimmydivvy
jimmydivvy / JavascriptIOMonadExample.js
Last active February 26, 2023 10:35
Simple IO Monad example in Javascript
class IO {
// We construct the IO type with a thunk/callback that returns the value when called
constructor( fn ){
this.fn = fn;
}
// IO doesn't do anything until we explicitly call it.
run(){
return this.fn();
@SupaHam
SupaHam / fix-mappings.bat
Last active August 29, 2015 14:17
A script to fix the LVT poop (aka snowmen) symbols being represented as local variables.
SET HASH="73f3c166"
SET JARFILE="work/supa_mapped_%HASH%.jar"
java -jar BuildData/bin/SpecialSource-2.jar map --kill-lvt -i work/minecraft_server.1.8.3.jar -m BuildData/mappings/bukkit-1.8.3-cl.csrg -o %JARFILE%-cl
java -jar BuildData/bin/SpecialSource-2.jar map --kill-lvt -i %JARFILE%-cl -m BuildData/mappings/bukkit-1.8.3-members.csrg -o %JARFILE%-m
java -jar BuildData/bin/SpecialSource.jar --kill-lvt -i %JARFILE%-m --access-transformer BuildData/mappings/bukkit-1.8.3.at -m BuildData/mappings/package.srg -o %JARFILE%
sh mvn install:install-file -Dfile=%JARFILE% -Dpackaging=jar -DgroupId=org.spigotmc -DartifactId=minecraft-server -Dversion=1.8.3-SNAPSHOT
:: This doesn't really help all that much, still need to investigate how to get it to produce
:: the same source to match SpecialSource's jar for IntelliJ IDEA to spot as a source directory
java -jar BuildData/bin/fernflower.jar -dgs=1 -hdc=0 -rbr=0 -asc=1 -udv=0 work/decompile-%HASH%/classes work/decompile-%HASH%