Skip to content

Instantly share code, notes, and snippets.

@dually8
dually8 / 1_instructions.md
Last active April 25, 2024 17:14
Transfer N64 saves to Nintendo Switch Online

How To Transfer N64 Saves To Nintendo Switch Online

This is a guide on how to transfer saves from an original n64 cart to NSO. While this isn't an exhaustive list, this should help get you started. Each save is different and has different instructions on how to transfer it depending on what kind of save it is. Please use the game list table to see how each game should be transferred.

NOTE: You will need a jailbroken switch in order to perform this. I personally use JKSV to transfer my saves back and forth.

EEP

Copy and paste the .eep file to the save directory and rename it to cartridge.sram.

@mbierman
mbierman / addremotesyslog.sh
Last active May 27, 2024 10:35
Add a remote syslog server to Firewalla
#!/bin/bash
# v 2.1.0
syslog=/etc/rsyslog.d/09-externalserver.conf
# this logs notice and above. use *.* log everything.
filter=*.notice
server=192.168.0.19 # Change the server to the IP of your syslog server.
port=514
hostname=firewalla
valid=$(grep "$server:$port" $syslog 2>/dev/null)
@androidfred
androidfred / noargs_setters_builders.md
Last active March 9, 2023 15:51
Stop using noargsconstructors and setters (and builders)

Stop using noargsconstructors and setters (and builders)

TLDR summary

Noargsconstructors and setters are outdated, 90's style old school Java. They needlessly allow entire categories of defects that are easily avoided by using only allargsconstructors and no setters. Please stop writing code like that.

Longer version

How many times have you come across (or written) code like this

public class User {
@Treeki
Treeki / TurnipPrices.cpp
Last active July 8, 2024 02:08
AC:NH turnip price calculator
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
// munged from https://github.com/simontime/Resead
namespace sead
{
class Random
{
@hkan
hkan / whatsapp-web-emoji-keywords.txt
Created April 30, 2018 16:25
Emoji shortcut keywords for Whatsapp Web
0⃣ 0, keycap, zero
1⃣ 1, number, one
🕜 1, 30, clock, time, one, thirty, 1:30, one-thirty
🕐 1, clock, time, one, 00, o’clock, 1:00, one o’clock
2⃣ 2, number, two
🕝 2, 30, clock, time, two, thirty, 2:30, two-thirty
🕑 2, clock, time, two, 00, o’clock, 2:00, two o’clock
3⃣ 3, keycap, three
🕞 3, 30, three, clock, time, thirty, 3:30, three-thirty
🕒 3, three, clock, time, 00, o’clock, 3:00, three o’clock
@charlesbedrosian
charlesbedrosian / 010_copy_build_extras.js
Last active March 19, 2020 11:01
Copy build-extras to platforms/android
#!/usr/bin/env node
//goes in hooks/after_platform_add/
var fs = require('fs');
rootdir = process.argv[2],
android_dir = rootdir + '/platforms/android';
gradle_file = rootdir + '/build-extras.gradle';
dest_gradle_file = android_dir + '/build-extras.gradle';
@zcaceres
zcaceres / Revealing-Module-Pattern.md
Last active June 18, 2024 00:44
Using the Revealing Module Pattern in Javascript

The Revealing Module Pattern in Javascript

Zach Caceres

Javascript does not have the typical 'private' and 'public' specifiers of more traditional object oriented languages like C# or Java. However, you can achieve the same effect through the clever application of Javascript's function-level scoping. The Revealing Module pattern is a design pattern for Javascript applications that elegantly solves this problem.

The central principle of the Revealing Module pattern is that all functionality and variables should be hidden unless deliberately exposed.

Let's imagine we have a music application where a musicPlayer.js file handles much of our user's experience. We need to access some methods, but shouldn't be able to mess with other methods or variables.

Using Function Scope to Create Public and Private Methods

/**
* Caches the return value of get accessors and methods.
*
* Notes:
* - Doesn't really make sense to put this on a method with parameters.
* - Creates an obscure non-enumerable property on the instance to store the memoized value.
* - Could use a WeakMap, but this way has support in old environments.
*/
export function Memoize(target: any, propertyName: string, descriptor: TypedPropertyDescriptor<any>) {
if (descriptor.value != null) {
@DBremen
DBremen / CleanData_CrossJoin.vb
Last active August 16, 2022 00:46
VBA Excel to cross-join and clean data with multiple entries per cell separated by comma or line-breaks
Private Function isSaved() As Boolean
Dim lastSaved As String
On Error GoTo EHandler
s = ActiveWorkbook.BuiltinDocumentProperties("last save time")
isSaved = True
Exit Function
EHandler:
isSaved = False
End Function
@stevemao
stevemao / np.sh
Last active July 4, 2024 19:42 — forked from sindresorhus/np.sh
Publish node module
# npm publish with goodies
# prerequisites:
# `npm install -g trash conventional-recommended-bump conventional-changelog conventional-github-releaser conventional-commits-detector json`
# `np` with optional argument `patch`/`minor`/`major`/`<version>`
# defaults to conventional-recommended-bump
# and optional argument preset `angular`/ `jquery` ...
# defaults to conventional-commits-detector
np() {
travis status --no-interactive &&
trash node_modules &>/dev/null;