Skip to content

Instantly share code, notes, and snippets.

View benjamingorman's full-sized avatar

Benjamin Gorman benjamingorman

View GitHub Profile
execute pathogen#infect()
set t_Co=256 "enable 256 terminal colours
colorscheme slate
set number
set ruler
set title
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab "always use spaces instead of tabs
@benjamingorman
benjamingorman / botfuncs.py
Created December 29, 2014 17:56
Robot functions for use with botchallenge
from botchallenge import *
import math
from hilbert import Hilbert
from copy import copy
rob = Robot("Normangorman", "europe.botchallenge.net")
print("Connected")
def smart_range(a, b):
if a == b:
@benjamingorman
benjamingorman / latest.log
Created December 30, 2014 01:32
Spigot server crash log
[01:49:00] [Server thread/INFO]: Starting minecraft server version 1.8
[01:49:00] [Server thread/INFO]: Loading properties
[01:49:00] [Server thread/INFO]: Default game type: SURVIVAL
[01:49:00] [Server thread/INFO]: This server is running CraftBukkit version git-Spigot-13716d9-0899683 (MC: 1.8) (Implementing API version 1.8-R0.1-SNAPSHOT)
[01:49:00] [Server thread/INFO]: Server Ping Player Sample Count: 12
[01:49:00] [Server thread/INFO]: Using 4 threads for Netty based IO
[01:49:00] [Server thread/INFO]: Debug logging is disabled
[01:49:00] [Server thread/INFO]: Generating keypair
[01:49:00] [Server thread/INFO]: Starting Minecraft server on *:25565
[01:49:00] [Server thread/INFO]: Set PluginClassLoader as parallel capable
@benjamingorman
benjamingorman / mvn_install_log.txt
Created December 30, 2014 16:10
Maven install log for RoboMinions
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for au.id.katharos:RoboMinionsPlugin:jar:0.0.1-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 8, column 19
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
@benjamingorman
benjamingorman / python_run_log.txt
Created December 30, 2014 17:42
Python connect to RoboMinions log
Traceback (most recent call last):
File "/usr/lib/python3.4/site-packages/google/protobuf/internal/python_message.py", line 839, in MergeFromString
if self._InternalParse(serialized, 0, length) != length:
File "/usr/lib/python3.4/site-packages/google/protobuf/internal/python_message.py", line 860, in InternalParse
(tag_bytes, new_pos) = local_ReadTag(buffer, pos)
File "/usr/lib/python3.4/site-packages/google/protobuf/internal/decoder.py", line 189, in ReadTag
while (ord(buffer[pos]) if py2 else buffer[pos]) & 0x80:
TypeError: unsupported operand type(s) for &: 'str' and 'int'
During handling of the above exception, another exception occurred:
import cProfile
import collections
def pascal(first, length):
row = []
a = first
for x in range(1, length):
# x and y form the ratio between consecutive elements
b = length - x
a = a * b // x # // is the integer division function
@benjamingorman
benjamingorman / parallel_waves.glsl
Last active August 29, 2015 14:19
Shader - Parallel waves
// credit: https://www.shadertoy.com/view/4dsGzH
vec2 uv = fragCoord.xy / iResolution.xy;
vec3 final_color = vec3(1.0); //white
vec3 bg_color = vec3(0.0); //black
vec3 wave_color = vec3(0.0); //black
float wave_width = 0.1;
uv = vec2(-1.0, -1.0) + 2.0 * uv; // convert to -1.0 < y < 1.0
uv.y += 0.1;
@benjamingorman
benjamingorman / gist:840f42cca525ab2cd6bf
Last active March 8, 2023 07:32
Shader - Circle and Rectangle functions
// returns 1.0 if inside circle
float disk(vec2 r, vec2 center, float radius) {
return 1.0 - smoothstep( radius-0.005, radius+0.005, length(r-center));
}
// returns 1.0 if inside the disk
float rectangle(vec2 r, vec2 bottomLeft, vec2 topRight) {
float ret;
float d = 0.005;
ret = smoothstep(bottomLeft.x-d, bottomLeft.x+d, r.x);
ret *= smoothstep(bottomLeft.y-d, bottomLeft.y+d, r.y);
@benjamingorman
benjamingorman / .vimrc
Created July 21, 2015 21:50
Laptop vimrc
execute pathogen#infect()
"Temporary bindings:
nmap <F5> :!love .<CR><CR>
""""""""""""
"PLUGINS
""""""""""""
"NERDTree
nmap \e :NERDTreeToggle<CR>
#
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
# Set directory of current project
export CURRENTPROJ=~/Projects
cd $CURRENTPROJ