Skip to content

Instantly share code, notes, and snippets.

@williewillus
williewillus / foo.java
Last active July 4, 2023 01:01
recipe to json dumper
// You can include this in your mod/a pack/whatever you want, as long as that work follows the Mojang EULA.
// The original source is viewable at https://gist.github.com/williewillus/a1a899ce5b0f0ba099078d46ae3dae6e
// This is a janky JSON generator, for porting from below 1.12 to 1.12.
// Simply replace calls to GameRegistry.addShapeless/ShapedRecipe with these methods, which will dump it to a json in RECIPE_DIR
// Also works with OD, replace GameRegistry.addRecipe(new ShapedOreRecipe/ShapelessOreRecipe with the same calls
// After you are done, call generateConstants()
// Note that in many cases, you can combine multiple old recipes into one, since you can now specify multiple possibilities for an ingredient without using the OD. See vanilla for examples.
private static final Gson GSON = new GsonBuilder().setPrettyPrinting().create();
According to all known laws of aviation, there is no way a bee should be able to fly.
Its wings are too small to get its fat little body off the ground.
The bee, of course, flies anyway because bees don't care what humans think is impossible.
Yellow, black. Yellow, black. Yellow, black. Yellow, black.
Ooh, black and yellow!
Let's shake it up a little.
Barry! Breakfast is ready!
Coming!
Hang on a second.
Hello?
@ubuntor
ubuntor / prime.thue
Last active May 22, 2016 16:30
Thue Nth Prime
# mark end
$1=1$;
$2=2$;
$3=3$;
$4=4$;
$5=5$;
$6=6$;
$7=7$;
$8=8$;
$9=9$;
# Defaults / Configuration options for homebridge
# The following settings tells homebridge where to find the config.json file and where to persist the data (i.e. pairing and others)
HOMEBRIDGE_OPTS=-U /var/lib/homebridge
# If you uncomment the following line, homebridge will log more
# You can display this via systemd's journalctl: journalctl -f -u homebridge
# DEBUG=*
@mmozeiko
mmozeiko / MemSpeed.cpp
Created December 21, 2014 19:48
Memory copy benchmark
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <xmmintrin.h> // SSE
#include <immintrin.h> // AVX
#ifdef _WIN32
#include <intrin.h> // for __movsb, __movsd, __movsq
@philipaconrad
philipaconrad / morse.py
Created June 23, 2013 18:28
Generates ITU-Standard morse code (in bit format) from ASCII text.
#morse.py -- Generates ITU-Standard morse code (in bit format) from ASCII text.
#MIT License -- Copyright (c) Philip Conrad 2013, all rights reserved.
import time #used for testing later.
morseITUStandard = {
"a" : [1, 0, 1,1,1], #dot dash
"b" : [1,1,1, 0, 1, 0, 1, 0, 1], #dash dot dot dot
"c" : [1,1,1, 0, 1, 0, 1,1,1, 0, 1], #dash dot dash dot
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Reversed Binary Numbers
~~~~~~~~~~~~~~~~~~~~~~~
Yi has moved to Sweden and now goes to school here. The first years of
schooling she got in China, and the curricula do not match completely in the
two countries. Yi likes mathematics, but now... The teacher explains the
algorithm for subtraction on the board, and Yi is bored. Maybe it is possible
@jtriley
jtriley / terminalsize.py
Created July 26, 2011 21:58
Get current terminal size on Linux, Mac, and Windows
#!/usr/bin/env python
import os
import shlex
import struct
import platform
import subprocess
def get_terminal_size():
""" getTerminalSize()
@endolith
endolith / Has weird right-to-left characters.txt
Last active June 1, 2024 10:58
Unicode kaomoji smileys emoticons emoji
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶