Skip to content

Instantly share code, notes, and snippets.

View MatthewCallis's full-sized avatar
🍖
Hungry Goriya

Matthew Callis MatthewCallis

🍖
Hungry Goriya
View GitHub Profile
@littletsu
littletsu / wrapper.js
Created September 18, 2018 05:52
Mini wrapper around discord API. Dependencies: snekfetch, ws. Heavily based in rylib by ry00001 (https://github.com/ry00001)
const fetch = require('snekfetch')
const ws = require("ws")
var logHeartbeat = false
// Weebsocket
get('gateway').then(gateway => {
let weebsocket = new ws(gateway.url)
@HS39
HS39 / asm65816.ccs
Last active February 19, 2022 21:51
//
// 65816 assembly opcodes
//
// Addressing mode tags:
//
// (none) Implied or Accumulator
// _i Immediate
// _8 Immediate, 8-bit register
// _d Direct page
// _di Direct indirect
import asm65816
// Overwrites Teleport Box battle action code
// 0xC2AB71 - 0xC2AC29
define Atk_Fail_Chk = 0xC2AB71 define NPC_Check = 0xC2AB71
define Miss_Calc = 0xC2AB75
define Smash = 0xC2AB79
define Determine_Dodge = 0xC2AB7D
define Level_2_Atk = 0xC2AB81
define Heal_Strangeness = 0xC2AB85
@devinacker
devinacker / exomizer-816.asm
Created July 10, 2018 01:13
WIP (sorta) Exomizer decruncher for SNES / 65c816 (with ca65)
.include "libSFX.i"
.feature force_range
.export Decrunch
/*
Exomizer (raw mode) decruncher for 65c816 / ca65.
by Devin Acker (Revenant/RSE), 2018
For use on SNES, and theoretically other 65c816-based platforms.

iOS restrictions re: bringing up the keyboard on programmatic focus

I can't find exact specifications on this, but it seems that iOS restricts bringing up the keyboard via programmatically focusing on <input>. It only brings up the keyboard in response to explicit user interaction.

  1. iOS focus on input field only brings up keyboard when called inside a click handler.
  2. It doesn’t work if the focus is async.

This presents a curious problem when you want to autofocus an input inside a modal or lightbox, since what you generally do is click on a button to bring up the lightbox, and then focus on the input after the lightbox has been opened. Without anything fancy, it actually works ok. The problem shows up when you try to add something fancy like a setTimeout or a promise.then(). I don't know why people would want to use a setTimeout here, but waiting for a promise is actually a pretty common use case. E.g. we try to batch dom manipulations like getting a lightbox to show up inside `requestAnimati

Strings

String.prototype.*

None of the string methods modify this – they always return fresh strings.

  • charAt(pos: number): string ES1

    Returns the character at index pos, as a string (JavaScript does not have a datatype for characters). str[i] is equivalent to str.charAt(i) and more concise (caveat: may not work on old engines).

Meltdown fix impact on Redis performances in virtualized environments

UPDATE: apparently kernel difference may have a serious impact, so I'll redo the test from scratch.

Test performed with AOF enabled, fsync policy 1 second, allowing the rewrites to be triggered.

Command lines used:

@Madsy
Madsy / build-65816-gas-toolchain.sh
Last active April 2, 2019 19:39
SNES 'lorom' toolchain.
#!/bin/bash
PREFIX=$(HOME)/snes-toolchain
#clone binutils development branch
git clone git://sourceware.org/git/binutils-gdb.git binutils-gdb
cd binutils-gdb
# Checkout a *very* old binutils commit from 2005, as gas support for the coff-w65 target was discontinued a long time ago.
# This version is the best one I found so far.
git checkout 0fdc72dad81fc7f32b898cb408da0300667f728b
@anpage
anpage / sfc2sfrom.py
Last active April 27, 2023 06:58
Scripts to convert SNES ROMs to SNES Classic (.sfrom) format and to read .sfrom headers
#!/usr/bin/env python
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
# AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
@yifanlu
yifanlu / vita-dumper-comparsion.md
Last active June 4, 2025 07:45
Vita Dumper Comparison
psvgamesd NoNpDrm Vitamin/MaiDumpTool
Dumps physical games
Dumps digital games, DLC, and updates
Compatible with legit DLC & updates
Saves usable on non-hacked Vitas
All original data untouched ❌❌
No problems saving after suspend ❌❌
Format can be converted to work with other tools
Installs physical games as bubbles