Skip to content

Instantly share code, notes, and snippets.

View FredrikAugust's full-sized avatar
🦦
Otters enjoy spending time in water.

Fredrik A. Madsen-Malmo FredrikAugust

🦦
Otters enjoy spending time in water.
View GitHub Profile
@FredrikAugust
FredrikAugust / main.rb
Created May 9, 2016 14:18
Next EA bestseller
#!/home/greg/.rvm/rubies/default/bin/ruby
require 'gosu'
# main class for the laser element in game
class Laser
attr_reader :created_at, :x, :y, :created_by
def initialize(window_size, angle, player)
@window_size = window_size
@FredrikAugust
FredrikAugust / color_thing.rb
Created April 12, 2016 19:35
Color thing wo/ GUI
#!/home/greg/.rvm/rubies/default/bin/ruby
require 'rmagick'
# monkeypatch string to convert bases
class String
def convert_base(from, to)
to_i(from).to_s(to)
end
end
@FredrikAugust
FredrikAugust / color_thing_gui.rb
Last active April 13, 2016 08:09
Color thing w/ GUI
#!/home/greg/.rvm/rubies/default/bin/ruby
require 'shoes'
class String
def convert_base(from, to)
to_i(from).to_s(to)
end
end
@FredrikAugust
FredrikAugust / read_aloud.rb
Last active March 13, 2016 19:39
Weechat read mentions and privmsgs
#!/usr/bin/ruby
# set username here!
NICK = "" # irc nick
IP = "" # computer on which to exec espeak
USER = "" # user on said computer
# this is all wizardry
# don't touch
#!/usr/bin/ruby
# This is a port of my previous hello-algo program,
# which was written in Common Lisp
#
# Written by Fredrik A. Madsen-Malmo
# init all global variables
# doesn't look as good if you include \t and \n in CHARS
@FredrikAugust
FredrikAugust / human-benchmarking-number-memory-test.js
Created March 8, 2016 21:29
cheat for the number memory test on human benchmarking
// Human Benchmarking - Number Memory Test cheat
// Written by Fredrik A. Madsen-Malmo
//
// For educational purposes only. Duh
// Error when trying to access jQuery outside top-level scope
var j = $;
var current_number;
// Assign in if for more DRY-ness
@FredrikAugust
FredrikAugust / human-benchmark-verbal-memory.js
Last active March 8, 2016 21:31
cheat for the verbal memory test on human benchmarking
// Human Benchmarking - Verbal Memory Test cheat
// Written by Fredrik A. Madsen-Malmo
//
// For educational purposes only. Duh
// Error when trying to access jQuery outside the top-level scope
var words = [];
var j = $;
var last;
@FredrikAugust
FredrikAugust / README.md
Last active May 12, 2019 01:21
Simple evolutionary algorithm written in Common Lisp that works its way towards a provided sentence.

Hello-algo

To use the program:

  • Install common lisp
  • Make sure it's installed by typing 'clisp'
  • Exec command "clisp path/to/file.lisp population string"
  • Tweak population to find what works best for you
@FredrikAugust
FredrikAugust / input.txt
Created November 4, 2015 10:05
Red Squiggle
accomodate
acknowlegement
arguemint
comitmment
deductabel
depindant
existanse
forworde
herrass
inadvartent
@FredrikAugust
FredrikAugust / classes.py
Last active September 23, 2015 22:36
Moon-adder for Solex
'''This is a simple script to create moon objects to use with
PietDaGamer's space-game.
This is the class file
'''
__author__ = 'Fredrik A. Madsen-Malmo'
class Moon:
"""Format: