Skip to content

Instantly share code, notes, and snippets.

View wallabra's full-sized avatar

wallabra wallabra

View GitHub Profile
@wallabra
wallabra / brazilian.md
Created July 16, 2018 14:39
You know you're Brazilian when...

Welcome to the Brazilian Culture

...by Natacha Marins

...translated to Portuguese and converted to website by Gustavo Rehermann


You know you're being Brazilian when...

@wallabra
wallabra / aur-install.sh
Last active March 10, 2018 17:14
Install AUR packages automatically.
#!/bin/bash
#------------
# This script installs Arch User Repository packages automatically.
# Learn more here:
# https://wiki.archlinux.org/index.php/Arch_User_Repository
#
# (C)2018 Gustavo R. Rehermann. The MIT License.
#------------
@wallabra
wallabra / triangle.coffee
Created November 23, 2017 13:53
Make and print right triangles
class RightTriangle
constructor: (@angle) ->
@angle = (@angle % 90) * Math.PI / 180
print: (size) =>
res = ""
last = 0
ot = Math.tan(@angle)
for i in [0...size]
@wallabra
wallabra / BreadcrumbII.uc
Created November 6, 2017 17:31
A* search (beta) in Unreal Tournament (1999)
class BreadcrumbII extends Actor;
// A* Search stuff
var(Breadcrumb_Search) float AdditionalCost;
var(Breadcrumb_Search) float DistanceFactor;
var(Breadcrumb_Search) float HeuristicFactor;
// Breadcrumb Linking stuff
var(Breadcrumb_Linker) float MaxLinkDistance;
var(Breadcrumb_Linker) float MinLinkDistance;
@wallabra
wallabra / translate.js
Created November 3, 2017 00:27
My attempt at translating an image and... 2 hard 2 explain
var a, b, brightness, checked, e, g, getBrightnessOf, icanvas, ictx, j, l, margin, pixels, r, ref, ref1, ref2, rx, ry, threshold, weight, x, y;
try
{
icanvas = document.createElement('canvas');
icanvas.width = img.naturalWidth;
icanvas.height = img.naturalHeight;
chunkSize *= renderer.canvas.height / 1000;
ictx = icanvas.getContext('2d');
ictx.drawImage(img, 0, 0, Math.floor(renderer.canvas.height * icanvas.width / icanvas.height / chunkSize), Math.floor(renderer.canvas.height / chunkSize));
map.clearResize(Math.floor(renderer.canvas.width / chunkSize), Math.floor(renderer.canvas.height / chunkSize));
@wallabra
wallabra / abstraction.js
Last active October 9, 2017 22:34
Abstract class library for Node.JS
// Generated by CoffeeScript 1.12.6
var AbstractClassError, AbstractFunction, AbstractionError, BadInheritanceError, abstractClass,
bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty,
indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
AbstractFunction = (function() {
function AbstractFunction(name) {
this.name = name;
@wallabra
wallabra / LeafSicklePlugin.java
Last active October 6, 2017 19:29
Leaf Sickle plugin prototype for Sponge API
package usr.gustavo6046.sponge.sickle;
import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.NoSuchFileException;
import java.nio.file.Paths;
import java.util.LinkedList;
@wallabra
wallabra / MyLevel.BSPNode.uc
Last active September 30, 2017 18:44
BSP node (incomplete) on UnrealScript.
//=============================================================================
// BSPNode.
//=============================================================================
class BSPNode expands Info;
struct TriPlane
{
var Vector points[3];
};
@wallabra
wallabra / Renderer.h
Created September 29, 2017 19:25
Another part
#ifndef RENDERER_H
#define RENDERER_H
#include <SFML/Graphics.hpp>
#include <vector>
#include <string>
#include <functional>
#include "Vector.hpp"
using std::function;
@wallabra
wallabra / Renderer.cpp
Created September 29, 2017 19:02
Part of upcoming grtlib v0.3 (NOT WORKING)
#include "Renderer.hpp"
#include <vector>
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include <SFML/System.hpp>
#include <string>
#include <iostream>
#include <memory>
#include <thread>