Skip to content

Instantly share code, notes, and snippets.

View itsmefox's full-sized avatar
🦊
If you can be a Fox

itsmefox itsmefox

🦊
If you can be a Fox
View GitHub Profile
@itsmefox
itsmefox / ParseRSAKeys.java
Created March 16, 2020 08:12 — forked from destan/ParseRSAKeys.java
Parse RSA public and private key pair from string in Java
import java.io.IOException;
import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.security.KeyFactory;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.interfaces.RSAPublicKey;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.PKCS8EncodedKeySpec;
@itsmefox
itsmefox / JavaIntToLittleEndianUnsigned
Created November 10, 2020 13:05 — forked from paulononaka/JavaIntToLittleEndianUnsigned
Convert a Int (in Java, big endian signed) to LittleEndian unsigned
private static byte[] intToLittleEndian(long numero) {
ByteBuffer bb = ByteBuffer.allocate(4);
bb.order(ByteOrder.LITTLE_ENDIAN);
bb.putInt((int) numero);
return bb.array();
}
// OR ...
private static byte[] intToLittleEndian(long numero) {
// apply this script into the build.gradle of modules which you have applied protobuf plugin
// also, this can be used to workaround others plugins not supporting macOS M1 soc, e.g. AndResGuard
// to support AndResGuard, append `|| it.name == "AndResGuardLocatorSevenZip"`
// to the configuration matching condition sentence
configurations.matching {
it.name.startsWith("protobufToolsLocator_")
}.configureEach {
withDependencies { deps ->
deps.matching { it instanceof ExternalDependency }.configureEach {
it.artifacts.each {
@itsmefox
itsmefox / discord_app_protocols.md
Created May 23, 2022 12:52 — forked from ghostrider-05/discord_app_protocols.md
An unofficial list of discord app protocols

Discord app protocols

Home:

  • /: discord://-/
  • friends: discord://-/channels/@me/
  • nitro: discord://-/store

General:

@itsmefox
itsmefox / psql_useful_stat_queries.sql
Created December 12, 2022 14:25 — forked from anvk/psql_useful_stat_queries.sql
List of some useful Stat Queries for PSQL
--- PSQL queries which also duplicated from https://github.com/anvk/AwesomePSQLList/blob/master/README.md
--- some of them taken from https://www.slideshare.net/alexeylesovsky/deep-dive-into-postgresql-statistics-54594192
-- I'm not an expert in PSQL. Just a developer who is trying to accumulate useful stat queries which could potentially explain problems in your Postgres DB.
------------
-- Basics --
------------
-- Get indexes of tables