Skip to content

Instantly share code, notes, and snippets.

Leo Battle Leowbattle

  • England
Block or report user

Report or block Leowbattle

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Leowbattle
Leowbattle / esc.rb
Created Jul 17, 2018
Turn C code into Spanish
View esc.rb
if ARGV.length == 0
puts "Usage: ruby esc.rb [filename]"
exit
end
prog = File.read ARGV[0]
prog = prog.gsub(/auto/, "automático")
prog = prog.gsub(/const/, "constante")
prog = prog.gsub(/double/, "doble");
@Leowbattle
Leowbattle / ruin_java.rb
Created Jul 2, 2018
Prank your friends by running this script on their Java project (please make sure it is backed up first)
View ruin_java.rb
javaFiles = Dir.glob "#{ARGV[0]}/**/*.java"
javaFiles.each do |javaFile|
javaCode = File.read javaFile
javaCode = javaCode.gsub /l|cl/, ""
File.open(javaFile, "w") {|file| file.puts javaCode}
end
View Event.hpp
#ifndef Event_hpp
#define Event_hpp
#include <vector>
#include <functional>
class Event;
typedef std::function<void(Event*)> EventHandler;
class Event {
View Event.cpp
#include "Event.hpp"
void Event::doEvent() {
for (int i = 0; i < handlers.size(); i++) {
handlers.at(i)->handle(this);
}
if (!cancelled) {
execute();
}
@Leowbattle
Leowbattle / TransitionScreen.java
Created Mar 3, 2018
Simple fade-in fade-out screen transition for libGDX
View TransitionScreen.java
package leo.sortorsplode;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
public class TransitionScreen implements Screen {
private Screen currentScreen;
private Screen nextScreen;
View DancersUK.py
# Set of default scores used to quickly debug without typing in scores every time.
# Scores taken from the booklet PDF.
defaultScores = {"A": [6, 9, 9, 10, 5],
"B": [7, 6, 8, 5, 4],
"C": [9, 5, 4, 7, 8],
"D": [5, 6, 9, 7, 6],
"E": [5, 6, 9, 7, 6],
"F": [6, 4, 7, 8, 7]
}
You can’t perform that action at this time.