Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
git log --pretty=format:'%s' --abbrev-commit $1 | sort | uniq > bd-$1-sorted
git log --pretty=format:'%s' --abbrev-commit $2 | sort | uniq > bd-$2-sorted
echo "writing hashes"
git log --pretty=format:'%h %s' --abbrev-commit $1 > bd-hashes
echo "" >> bd-hashes
git log --pretty=format:'%h %s' --abbrev-commit $2 >> bd-hashes
@Deamon5550
Deamon5550 / random_test.cc
Created October 6, 2017 00:15
SIMD Mersenne Twister
#include <chrono>
#include <ctime>
#include <random>
#include <ratio>
#include <cmath>
#include <cinttypes>
#include "boost/random.hpp"
#include <x86intrin.h>
package com.voxelgenesis.test.inject;
import com.voxelgenesis.injector.Inject;
import com.voxelgenesis.injector.Injector;
import com.voxelgenesis.test.TestTarget;
@Injector(TestTarget.class)
public class MixinTestTarget {
// This injection is replacing the value of the local assignment
@Deamon5550
Deamon5550 / gotos.kt
Created March 27, 2017 19:09
Kotlin Bytecode Issues
fun main(args: Array<String>) {
val x = 10
val y = 9
if(x == 6) {
if(y == 6) {
println("a")
} else {
println("b")
}
} else {
@Deamon5550
Deamon5550 / goto.kt
Created March 27, 2017 17:00
Kotlin's lack of optimizations of gotos
fun main(args: Array<String>) {
val x = 10
val y = 9
if(x == 6) {
if(y == 6) {
println("a")
} else {
println("b")
}
} else {
package net.minecraft.block.material;
public class Material {
public static final Material AIR = new MaterialTransparent(MapColor.AIR);
public static final Material GRASS = new Material(MapColor.GRASS);
public static final Material GROUND = new Material(MapColor.DIRT);
public static final Material WOOD = new Material(MapColor.WOOD).setBurning();
public static final Material ROCK = new Material(MapColor.STONE).setRequiresTool();
public static final Material IRON = new Material(MapColor.IRON).setRequiresTool();
import java.util.List;
import java.util.Random;
import javax.annotation.Nullable;
import net.minecraft.block.material.EnumPushReaction;
import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
Handles structures that are saved to disk. Certain structures
can take up large amounts of disk space for very large maps,
and the data for these structures is only needed while the
world around them is generating. Disabling saving of these structures
can save disk space and time during saves if your world is already
fully generated. Warning: disabling structure saving will break
the vanilla locate command.
private static enum CompareOps {
AND,
OR,
MID,
MID_OR
}
private static class ConditionResult {
public Condition condition;
@Deamon5550
Deamon5550 / CustomBiomes.java
Created September 10, 2016 02:05
Sponge Virtual biomes test
/*
* This file is part of SpongeAPI, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell