Skip to content

Instantly share code, notes, and snippets.

const slp = require('slp-parser-js');
const SlippiGame = slp.default;
const path = require('path');
const fs = require('fs');
const _ = require('lodash');
const cliProgress = require("cli-progress");
const inputFolder = "./Slippi";
const outputFolder = "./sorted";
@vinceau
vinceau / resx_to_json.py
Created April 21, 2020 05:52
Converts a resx file to json. Usage: python3 resx_to_json.py *.resx
import json
import sys
import xml.etree.ElementTree as ET
def parseXML(xmlFile):
tree = ET.parse(xmlFile)
root = tree.getroot()
# create empty dictionary where we will save data
data = {}
@vinceau
vinceau / fakeSlpStream.js
Last active January 8, 2020 07:47
Fake Slippi Stream
/**
This script demonstrates using a Slippi files as a fake live Slippi stream.
*/
var tailstream = require('tailstream');
const { SlippiRealtime, SlpStream } = require("@vinceau/slp-realtime");
const path = require('path');
const chokidar = require("chokidar");
const fs = require('fs');
@vinceau
vinceau / ipns_publish.sh
Last active October 3, 2019 04:27
Add a file to IPFS and publish it on IPNS
#!/usr/bin/env bash
# Usage:
# ./ipns_publish.sh keyname some_file.txt
LIFETIME="2160h"
# Check valid number of arguments
if [ "$#" -ne 2 ]; then
echo "Invalid arguments. Expected 2, got $#"
@vinceau
vinceau / getSlippiCombos.js
Created August 31, 2019 02:32 — forked from NikhilNarayana/getSlippiCombos.js
Get Combos from Slippi files -- READ THE FIRST COMMENT BELOW
const fs = require('fs');
const _ = require('lodash');
const path = require('path');
const { default: SlippiGame } = require('slp-parser-js'); // npm install slp-parser-js
const basePath = path.join(__dirname, 'slp/'); // this var is "<directory your script is in>/slp"
const dolphin = {
"mode": "queue",
"replay": "",
@vinceau
vinceau / sketch.sh
Created May 12, 2019 23:50
Unlimited Sketch trial
#!/bin/bash
if [ $EUID != 0 ]; then
sudo "$0" "$@"
exit $?
fi
date 0102030405
open /Applications/Sketch.app
@vinceau
vinceau / DisplayFormikState.tsx
Created September 13, 2018 00:37
Component to display formik state for debugging.
export const DisplayFormikState = (props: any) =>
<div style={{ margin: "1rem 0" }}>
<h3 style={{ fontFamily: "monospace" }} />
<pre
style={{
background: "#f6f8fa",
fontSize: ".65rem",
padding: ".5rem",
}}
>
// ==UserScript==
// @name Twitter Analytics
// @description Adds links to actual tweets on twitter analytics
// @version 0.2
// @author Vincent Au
// @namespace vince.id.au
// @include *analytics.twitter.com/user/*
// ==/UserScript==
// Last edited 9 November 2017
@vinceau
vinceau / sorting.go
Created May 28, 2018 08:34
Concurrent sorting algorithms in GoLang
/*
Build a concurrent sorting algorithm in Go using channels
Sorting algorithms are well understood, and sequential implementations are simple to build. For each of your favourite sorting algorithms, build concurrent versions that utilize channels for communicating between Goroutines. Experiment with a pipelining approach, where the sorting is split into stages and each stage is handled by a Goroutine, and fork/join approach, where data to be sorted is split into smaller subsets and a Goroutine is created for each subset.
*/
package main
@vinceau
vinceau / numeric_keypad_mod.json
Last active April 18, 2018 07:01
Modified numeric keypad for Karabiner Elements with left command as spacebar, and right command as additional zero. Install using: karabiner://karabiner/assets/complex_modifications/import?url=https://gist.github.com/vinceau/0dafc3f0753c1a5ca8c7e65f0f1766ff/raw/c599e111805a7561b5a9125af31c89be28c7a81a/numeric_keypad_mod.json
{
"title": "Modified Numeric Keypad",
"rules": [
{
"description": "Modified Numeric Keypad Mode [Tab as trigger key]",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "tab"