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")
@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
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!
},