Skip to content

Instantly share code, notes, and snippets.

View remino's full-sized avatar

Rem remino

View GitHub Profile
@remino
remino / README.md
Last active March 31, 2024 02:09
Nintendo Switch: Copy files from old microSD card to new microSD card

Nintendo Switch: Copy files from old microSD card to new microSD card

I'm frustrated every time I upgrade my microSD card in my Nintendo Switch, because no matter what I did before writing the switchcp.bat batch file, nothing seemed to work. Everything I'd do would eventually make a microSD card unreadable by my Switch.

After toying around with this problem for hours, below are some conclusions I've drawn. I can't take responsability for any data loss or damage to your systems. However, I do hope they can help you:

  • Don't copy your files using macOS or Linux. This is a big one. The ExFAT file system used by microSD cards of large capacity (microSDHC or microSDXC) is a proprietary file system by Microsoft. No matter how much licencing was negotiated between OS makers or how much backward engineering was done, only Windows seems to get reading and writing files on ExFAT file systems right. As a Mac user, I was determined to use macOS to do the job, until I tried with a Windows VM and saw all my prob
@remino
remino / hinomaru-short.html
Created January 5, 2012 03:57
Flag of Japan 日の丸 HTML5+SVG+CSS
<svg xmlns="http://www.w3.org/2000/svg" background="#eee" width=420 height=280><circle cx="50%" cy="50%" r="24%" fill="#bc002d" /></svg>
@remino
remino / threelights.blender.py
Last active November 18, 2023 04:51
Script to create a three-light set-up scene in Blender
# threelights.blender.py
# By Rémino Rem <remino.net>
# 2023-11-18
#
# This creates a three-light scene set-up in Blender. Works in Blender 4.
#
# Best run in a blank file, as it will destroy anything in the scene.
import bpy
import mathutils
@remino
remino / template.sh
Created May 26, 2022 14:29
POSIX-compliant shell script template
#!/bin/sh
# unnamedscript
unnamedscript_main() {
e_args=16
e_no_realpath=17
which realpath 2>&1 > /dev/null \
|| _fatal $e_no_realpath "realpath missing."
@remino
remino / array-last-item.sh
Created May 26, 2022 10:23
Shell script: Get last item in array
for last; do true; done
echo $last
@remino
remino / basic.example.html
Created May 24, 2022 05:44
Minimal valid HTML5 document
<!doctype html>
<title>Valid HTML5 Document</title>
This is a valid HTML5 document.
@remino
remino / datediff.js
Created January 5, 2012 06:07
JavaScript: DateDiff & DateMeasure: Calculate days, hours, minutes, seconds between two Dates
(function() {
function DateDiff(date1, date2) {
this.days = null;
this.hours = null;
this.minutes = null;
this.seconds = null;
this.date1 = date1;
this.date2 = date2;
@remino
remino / node-es-filename-dirname.js
Created October 25, 2021 05:50
Get __filename & __dirname in Node native ES modules
// Get __filename & __dirname in Node native ES modules
import { URL } from 'url'
const __filename = new URL('', import.meta.url).pathname
const __dirname = new URL('.', import.meta.url).pathname
console.log(__filename)
console.log(__dirname)
@remino
remino / json_http_headers.php
Created January 6, 2016 08:45
Return browser headers in JSON
<?php
class JsonHttpHeaders {
function headers() {
$headers = '';
foreach ($_SERVER as $name => $value) {
if (substr($name, 0, 5) == 'HTTP_') {
$header_name =
str_replace(' ', '-',
ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))));
@remino
remino / ssh-via.sh
Created January 22, 2014 08:51
ssh-via: Connect to SSH host via proxy
#!/bin/sh
ssl_via() {
if [ $# -lt 2 ]
then
ssl_via_usage
return
fi
ssl_via_main $@