Skip to content

Instantly share code, notes, and snippets.

View bates64's full-sized avatar

Alex Bates bates64

View GitHub Profile
@bates64
bates64 / log-to-sym.ps1
Last active February 17, 2020 19:31
Star Rod compile.log to Project 64 symbols file script
# log-to-sym.ps1 v2
# https://gist.github.com/nanaian/8e2faf8909d15ad393b0802c7aa60bf7
#
# compile.log to Project 64 symbols file script
# by alex (imalex.xyz)
#
# usage:
# place this script in the $mod/logs directory
# compile with Star Rod as usual
# run this script (`.\log-to-sym.ps1` in PowerShell) and a PAPER MARIO.sym file will be produced
New-Item -ItemType Directory -Force -Path "$HOME\.starpkg"
Invoke-WebRequest -Uri "https://github.com/nanaian/starpkg/releases/latest/download/starpkg-x86_64-pc-windows-msvc.zip" -OutFile "~\Downloads\starpkg.zip"
Expand-Archive -Force -Path "~\Downloads\starpkg.zip" -DestinationPath "$HOME\.starpkg"
Remove-Item "~\Downloads\starpkg.zip"
$path = [Environment]::GetEnvironmentVariable("Path", "User")
if ($path -notlike "*$HOME\.starpkg*") {
[Environment]::SetEnvironmentVariable("Path", "$HOME\.starpkg;" + $path, "User")

Keybase proof

I hereby claim:

  • I am nanaian on github.
  • I am nanalan (https://keybase.io/nanalan) on keybase.
  • I have a public key ASC7lulo9UdzDEzNxFV98hoFPvHXjxLEJ4vlLhM6ZIXyGAo

To claim this, I am signing this object:

@bates64
bates64 / mrk+image.js
Last active March 5, 2018 22:38
Image extension for mrk
const markImage = mrk({
extendPatterns: {
image: ({ read, readUntil }, meta) => {
if (read(2) !== '![') return
// All characters up to `]` are the alt text
const alt = readUntil(']')
if (read(2) !== '](') return
@bates64
bates64 / mrk+strikethrough.js
Last active March 5, 2018 22:37
Strikethrough extension for mrk (https://github.com/heyitsmeuralex/mrk)
const markStrikethrough = mrk({
extendPatterns: {
strikethroughStart: ({ read, has }) => {
// If this function returns a truthy value, it will be parsed as a strikethroughStart token
// See mrk.js for how `read` and `has` work, plus other functions you get access to.
return read(2) === '~~' // Next 2 characters should be `~~`
&& !has('strikethroughStart', 'strikethroughEnd') // Not already strikethrough!
},
@bates64
bates64 / yt-volume-speed.user.js
Created June 26, 2017 20:25
Userscript that sets YouTube video playback speed based on the current volume. Satanic.
// ==UserScript==
// @name [YT] Volume -> Speed
// @author Satan
// @namespace youtube.com
// @description YouTube videos change playback speed based on the current volume. Fun.
// @include https://www.youtube.com/watch?v=*
// @version 1.0
// @grant none
// ==/UserScript==