Skip to content

Instantly share code, notes, and snippets.

@aqt
aqt / the_messenger_save_decoder.js
Last active May 8, 2024 17:44
Decode/encode save files used by the game The Messenger
#!/usr/bin/env node
/*
If you run the script on an encoded file it will output a decoded file and
vise versa, because the action used to encode/decode is identical. The save
file format when decoded is plaintext JSON, which you can edit with your
favorite text editor.
You can find the save file at the following path. Please make a backup of the
@bergmannjg
bergmannjg / rearct-native-app-in-wsl2.md
Last active May 8, 2024 17:43
Building a react native app in WSL2
@jam1garner
jam1garner / switch-gdb-cheatsheet.md
Last active May 8, 2024 17:43
GDB for Switch Modding Cheatsheet/Tutorial

This is a mini-tutorial of sorts for getting started with gdb on the Switch, with the target audience being people who want to mod and/or reverse games, with no prerequisite knowledge of gdb. The goal will be to walk you through some of the basic workflows needed to use a debugger on the Switch, while being brief enough for skimming for when you forget things.

If some part is unclear, your OS doesn't have install instructions, or you feel part of your workflow should be added here, feel free to comment any additions.

(If you only need a quick reference Jump to the Appendix)

Installing GDB

First off you'll need a version of GDB compatible with aarch64. This can be obtained via either a distribution of

@wojteklu
wojteklu / clean_code.md
Last active May 8, 2024 17:42
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@jakebrinkmann
jakebrinkmann / connect_psycopg2_to_pandas.py
Created July 3, 2017 14:19
Read SQL query from psycopg2 into pandas dataframe
import pandas as pd
import pandas.io.sql as sqlio
import psycopg2
conn = psycopg2.connect("host='{}' port={} dbname='{}' user={} password={}".format(host, port, dbname, username, pwd))
sql = "select count(*) from table;"
dat = sqlio.read_sql_query(sql, conn)
conn = None

Mounting BitLocker-encrypted NTFS drives as read/write on MacOS Ventura

BitLocker encryption has become a common alternative for securing personal files and is nowadays natively supported by Linux, at least within GNOME. Some additional steps, however, are still required to ensure full MacOS compatibility. This guide describes the necessary steps to achieve it.

Requirements

We require three packages: macFUSE, ntfs-3g (and brew), and dislocker.

1/3: Install macFUSE

@strengejacke
strengejacke / .lintr
Last active May 8, 2024 17:39
VS Code setup for R
// save to windows-user directory
linters: with_defaults(object_name_linter = NULL,
object_length_linter(50),
commented_code_linter = NULL,
object_usage_linter = NULL,
line_length_linter(120),
cyclocomp_linter = cyclocomp_linter(50))
@chetan
chetan / dumpcerts.traefik.v2.sh
Created November 9, 2023 16:24
Convert traefik acme.json to PEM files
#!/usr/bin/env bash
# Copyright (c) 2017 Brian 'redbeard' Harrington <redbeard@dead-city.org>
#
# dumpcerts.sh - A simple utility to explode a Traefik acme.json file into a
# directory of certificates and a private key
#
# Usage - dumpcerts.sh /etc/traefik/acme.json /etc/ssl/
#
# Dependencies -
# util-linux
%Categorias
categoria(fantasia).
categoria(novela).
categoria(ciencia_ficcion).
categoria(misterio).
categoria(poemas).
categoria(historia).
categoria(autoayuda).
categoria(romance).
categoria(aventura).
@christech1117
christech1117 / Markdown教學.md
Last active May 8, 2024 17:37
Markdown教學,每個部分的教學分為兩個區塊,上半部為markdown語法,下半部為顯示結果