Skip to content

Instantly share code, notes, and snippets.

View jamierocks's full-sized avatar

Jamie jamierocks

View GitHub Profile
@AbrarSyed
AbrarSyed / build.gradle
Last active August 30, 2020 04:37
A custom script to build custom MCP snapshots.
apply plugin: "java"
apply plugin: "maven"
// edit this area only.
// the build.gradle would have the patttern minecraft { mappings = "channel_dlVersion" }
ext.channel = "SomeRandomName"
ext.dlVersion = "custom"
ext.mcVersion = "1.7.10" // the targetted MC version
group = "de.oceanlabs.mcp"
@matthewprenger
matthewprenger / 01-mapping_update_instructions.txt
Last active December 18, 2019 16:16
Place the new methods.csv and fields.csv in the root of your project (TEMPORARILY, Don't commit these to git!) and add this to the end of your build.gradle and run 'gradle updateMappings`. Updated sources will be placed in src_remapped/main/java. You should do a diff to ensure that they are correct and then replace src/main/java with them.
Important note: Your code must compile on the old mappings, and the obfSourceJar must be enabled (it is by default)
1. Download a copy of the new methods.csv and fields.csv from http://export.mcpbot.bspk.rs/ to the root of your project.
2. Add the following gradle script to your build.gradle.
3. Run 'gradle(w) updateMappings'.
4. Do a diff between src/main/java/ and src_remapped/main/java/ to make sure everything looks right.
5. replace src/main/java/* with src_remapped/main/java/*
@omnidan
omnidan / PrettyJsonResponse.php
Last active July 17, 2019 12:48
Pretty-printed Symfony JsonResponse class. 100% compatible with the original class, requires PHP 5.4.0 or higher.
<?php
/**
* @license WTFPL (Do What the Fuck You Want to Public License)
* @author Daniel Bugl <daniel.bugl@touchlay.com>
*/
namespace TouchLay\HelperBundle\Component;
use Symfony\Component\HttpFoundation\JsonResponse;
@gigaherz
gigaherz / ALU.vhdl
Created October 14, 2013 19:28
An implementation of a simple 4-instruction CPU, in VHDL
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_arith.all;
use IEEE.std_logic_unsigned.all;
use work.constants.all;
use work.ctypes.all;
entity ALU is port (
clk : in std_logic;
package com.unascribed.materialpicker;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Random;
public enum MaterialColor {
RED("Red",
0xFF_F44336,
@falkreon
falkreon / InvertedNormalRandom.java
Last active August 22, 2017 17:25
Selecting unusually-distributed pseudorandom numbers
/**
* Creates a random number from (-1..1), exclusive, distributed in an inverse-bell-curve fashion. That is, numbers
* closer to -1 or 1 are exponentially more likely to appear than numbers closer to 0.
*/
public static double invertedNormalRandom(Random r) {
/*
* Implementation note: log10 reaches y=0 at x=1, and reaches y=1 at x=10, so it's really important, if we
* want to get good numbers out of it, to feed it numbers in the range of 1..10. So we multiply by 9 and add 1.
*/
double a = Math.log10((r.nextDouble()*9)+1);
@naelstrof
naelstrof / seen.sh
Last active December 9, 2016 14:38
Takes screenshots and videos of user selection, automatically uploads to a server mounted on your system, then copies the URL to your clipboard.Depends on xclip, ffmpeg, maim, mplayer, and slop.Use "seen.sh image" to capture an image, and use "seen.sh video" to start recording a video. Then use "seen.sh video" again to stop recording.I use maim …
#!/bin/bash
server="/mnt/charles/farmstore/content/${1}s"
url="http://farmpolice.com/content/${1}s"
imageEncoding=".png"
videoEncoding=".webm"
imagetake="/usr/share/sounds/freedesktop/stereo/screen-capture.oga"
videotake="/usr/share/sounds/freedesktop/stereo/complete.oga"
name=$(cat /dev/urandom | tr -cd 'a-f0-9' | head -c 8)
pidFile="/tmp/seen_record.pid"
@Deamon5550
Deamon5550 / Summary.md
Last active August 14, 2016 17:15
Sponge Event Benchmarking

All Tests were performed with 20 warmup iterations of 10000 cycles and 40 benchmarking iterations of 50000 cycles. Times are all in milliseconds.

These arguments were choosen such that the GC pauses would be long, but infrequent. VM arguments: -verbose:gc -Xbatch -XX:CICompilerCount=1 -XX:-TieredCompilation -Xmx10G -Xms10G -XX:+UseG1GC -XX:MaxGCPauseMillis=500 -XX:InitiatingHeapOccupancyPercent=80

Guava:

@Vazkii
Vazkii / LiMI.java
Created December 7, 2015 00:01
LiMI - Lightweight Mod Indicator
package vazkii.limi;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.ModContainer;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;