This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
git filter-branch --env-filter ' | |
CORRECT_NAME="YOUR_NAME" | |
CORRECT_EMAIL="YOUR_EMAIL" | |
if [ "$GIT_COMMITTER_EMAIL" != "$CORRECT_EMAIL" ] | |
then | |
export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL" | |
export GIT_COMMITTER_NAME="$CORRECT_NAME" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
buildscript { | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:0.12.200' | |
} | |
} | |
apply plugin: 'kotlin' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fish f | |
⍝ Variables | |
⎕IO←0 ⍝ Arrays start with 0 | |
S←⍬ ⍝ This will hold the stack(s) | |
i←'' ⍝ This is an input buffer | |
s←,0 ⍝ This will hold the markers for [ and ], the first stack is at pos 0. | |
D←4 2⍴D,⌽D←0 1 0 ¯1 ⍝ Directions | |
p←0 0 ⍝ Position (start at 0,0) | |
v←0 ⍝ This is set to 1 when reading a string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.Point; | |
import java.util.*; | |
public abstract class AbstractLattice implements Tiling<AbstractLattice.LatticeCell> { | |
// Use the idea of expansion and vertex mapping from my earlier aperiod tiling implementation. | |
private Map<Point, Set<LatticeCell>> vertexNeighbourhood = new HashMap<Point, Set<LatticeCell>>(); | |
private int scale = -1; | |
// Geometry | |
private final int dx0, dy0, dx1, dy1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package self.vpalepu.stackoverflow; | |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.IOException; | |
import org.objectweb.asm.ClassReader; | |
import org.objectweb.asm.ClassVisitor; | |
import org.objectweb.asm.ClassWriter; | |
import org.objectweb.asm.MethodVisitor; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void giveNinjaInv(Player p) { | |
p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, Integer.MAX_VALUE, 2, false)); | |
p.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, Integer.MAX_VALUE, 1, false)); | |
ItemStack helm = new ItemStack(Material.LEATHER_HELMET, 1); | |
LeatherArmorMeta mh = (LeatherArmorMeta) helm.getItemMeta(); | |
mh.setColor(Color.fromRGB(68, 68, 68)); | |
helm.setItemMeta(mh); | |
ItemStack chest = new ItemStack(Material.LEATHER_CHESTPLATE, 1); | |
LeatherArmorMeta mc = (LeatherArmorMeta) chest.getItemMeta(); | |
mc.setColor(Color.fromRGB(68, 68, 68)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package xyz.jadonfowler.phasebot.world; | |
import java.util.*; | |
import lombok.*; | |
import xyz.jadonfowler.phasebot.world.material.*; | |
public enum ToolStrength { | |
//@formatter:off | |
WOOD(2f, Material.fromString("wood_sword", "wood_pickaxe", "wood_axe", "wood_spade", "wood_hoe")), | |
STONE(4f, Material.fromString("stone_sword", "stone_pickaxe", "stone_axe", "stone_spade", "stone_hoe")), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <netinet/in.h> | |
#include <netdb.h> | |
void error(char *msg) { | |
perror(msg); | |
exit(0); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String text = "attack 500." //description of card | |
String[] sentences = text.split("."); //each sentence will be parsed as a command | |
ArrayList<Token> tokens = new ArrayList<Token>(); //each sentence translates to a set of tokens | |
for(String s : sentences) | |
for(String word : s.split(" ")) | |
if(word.equalsIgnoreCase("attack")) | |
tokens.add(new AttackToken()); //add attack token if the word is Attack |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
import sys | |
import argparse | |
#Characters | |
superscript = [ | |
"\u030d", "\u030e", "\u0304", "\u0305", "\u033f", | |
"\u0311", "\u0306", "\u0310", "\u0352", "\u0357", | |
"\u0351", "\u0307", "\u0308", "\u030a", "\u0342", | |
"\u0343", "\u0344", "\u034a", "\u034b", "\u034c", |