Skip to content

Instantly share code, notes, and snippets.

@fancellu
fancellu / OkScalaTorSocksSttp.scala
Last active March 2, 2024 08:12
Shows how to use okhttp and sttp in Scala asynchronously to talk to a Tor onion address via a Tor socks proxy, without trying to resolve DNS outside of proxy
// Shows how to use okhttp and sttp in Scala asynchronously to talk to a Tor onion address via a Tor socks proxy,
// without trying to resolve DNS outside of proxy (few http clients do this properly and instead return UnknownHostException)
// libraryDependencies ++= Seq("com.squareup.okhttp3" % "okhttp" % "4.7.2",
// "com.softwaremill.sttp.client" %% "okhttp-backend" % "2.1.2"))
import java.io.IOException
import java.net.{InetSocketAddress, Proxy}
import okhttp3.{Call, Callback, OkHttpClient, Request, Response}
@vimtaai
vimtaai / markdown-flavors.md
Last active June 5, 2025 19:50
Comparison of features in various Markdown flavors

Comparison of syntax extensions in Markdown flavors

I created a crude comparison of the syntax of the various common Markdown extensions to have a better view on what are the most common extensions and what is the most widely accepted syntax for them. The list of Markdown flavors that I looked at was based on the list found on CommonMark's GitHub Wiki.

Flavor Superscript Subscript Deletion*
Strikethrough
Insertion* Highlight* Footnote Task list Table Abbr Deflist Smart typo TOC Math Math Block Mermaid
GFM
package com.bringholm.testplugin.bukkitutils;
import com.google.common.collect.Maps;
import org.apache.commons.lang.Validate;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;
import org.bukkit.Bukkit;
import org.bukkit.plugin.Plugin;
import org.bukkit.scheduler.BukkitRunnable;
import org.json.simple.JSONArray;
@TuxCoding
TuxCoding / Account.java
Created December 9, 2016 14:54
Upload a Minecraft skin automatically
package com.github.games647.changeskin.core.model.mojang.auth;
import com.github.games647.changeskin.core.model.PlayerProfile;
public class Account {
private final PlayerProfile profile;
private final String accessToken;
public Account(PlayerProfile profile, String accessToken) {
@MineTheCube
MineTheCube / texture-to-head.php
Created September 1, 2016 18:27
Get head picture from base64 encoded texture
<?php
// Encoded equivalent of:
// {"textures":{"SKIN":{"url":"http://textures.minecraft.net/texture/56936d4f0d1b93fef775b1fbd19281b70c6f88475bb5a41bf372c12f1f8a22"}}}
$base64 = 'eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNTY5MzZkNGYwZDFiOTNmZWY3NzViMWZiZDE5MjgxYjcwYzZmODg0NzViYjVhNDFiZjM3MmMxMmYxZjhhMjIifX19';
// Return skin from base64 texture
function get_head_from_texture($base64) {
$texture = json_decode(base64_decode($base64), true);
if (is_array($texture) and isset($texture['textures'], $texture['textures']['SKIN'], $texture['textures']['SKIN']['url'])) {
@unascribed
unascribed / BrokenHash.java
Last active March 28, 2024 16:10
How to generate a (correct) Minecraft-style hex digest. Tested.
package com.unascribed.brokenhash;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.nio.charset.StandardCharsets;
/**
* Generates a broken Minecraft-style twos-complement signed
@kirilkirkov
kirilkirkov / Multipart RAR Files
Created October 19, 2015 08:29
What is multipart archive
Hi! I am a complete newbie to RAR files and I want to learn what to do with them. I was just wondering:
What is a multipart RAR file?
1. A multipart RAR file is a standard RAR file, that was split into many smaller parts. This way, very large Archives can be placed on many small mediums, e.g. CDs.
2. The parts of a multipart RAR file are usually named "xyz.part1.rar", "yxz.part2.rar" etc. or "xyz.rar", "xyz.r01", "xyz.r02" etc. Depending on how many parts have been generated, there may be a few or a few hundred of these files.
3. A multipart RAR file can additionally be encrypted and protected by a password. Read more on password protection in the protected RAR files section of this FAQ.
4. BE CAREFUL: Sometimes multipart RAR files are used for phishing. Learn more in the phishing RAR files section of this FAQ.
5. Sometimes a multipart RAR file can be damaged and corrupted. Please take a look at the corrupted RAR files section of this FAQ to learn more.
Hi! I am an absolute beginner and
@bcoles
bcoles / 7zip-jtr.sh
Last active April 23, 2024 19:17
7zip-JTR Decrypt Script
#!/bin/bash
# 7zip-JTR Decrypt Script
#
# Clone of JTR Decrypt Scripts by synacl modified for 7zip
# - RAR-JTR Decrypt Script - https://synacl.wordpress.com/2012/02/10/using-john-the-ripper-to-crack-a-password-protected-rar-archive/
# - ZIP-JTR Decrypt Script - https://synacl.wordpress.com/2012/08/18/decrypting-a-zip-using-john-the-ripper/
echo "7zip-JTR Decrypt Script";
if [ $# -ne 2 ]
then
@roachhd
roachhd / README.md
Created December 8, 2014 23:09
Games on GitHub

Games on GitHub

Below is a list of open source games and game-related projects that can be found on GitHub - old school text adventures, educational games, 8-bit platform games, browser-based games, indie games, GameJam projects, add-ons/maps/hacks/plugins for commercial games, libraries, frameworks, engines, you name it.

Contributing

If you'd like to add a repository to the list, please create an Issue, or fork this repository and submit a pull request.

Help: MarkDown Help, Markdown Cheatsheet

@ondrek
ondrek / gist:7413434
Created November 11, 2013 13:48
Smallest Base64 image
data:image/gif;base64,R0lGODlhAQABAAAAACw=