Skip to content

Instantly share code, notes, and snippets.

View Kyrremann's full-sized avatar
🐘

Kyrre Havik Kyrremann

🐘
View GitHub Profile
@Kyrremann
Kyrremann / matrix.c
Created October 19, 2023 16:47
Trying to reverse matrix scan, as all my diodes are the wrong way.
/*
Copyright 2012-2023 Jun Wako <wakojun@gmail.com> Kyrremann <kyrremann@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
@Kyrremann
Kyrremann / moh_byer.rb
Last active March 25, 2021 13:23
Simple Ruby script to get elevations for Norwegian cities
require 'httparty'
require 'nokogiri'
require 'open-uri'
require 'cgi'
require 'json'
cities = ['Alta', 'Arendal', 'Askim_(tettsted)', 'Bergen', 'Bodø', 'Brekstad', 'Brevik', 'Brumunddal', 'Bryne', 'Brønnøysund', 'Drammen', 'Drøbak', 'Egersund', 'Elverum', 'Fagernes', 'Farsund', 'Fauske', 'Finnsnes', 'Flekkefjord', 'Florø', 'Fosnavåg', 'Fredrikstad', 'Førde', 'Gjøvik', 'Grimstad', 'Halden', 'Hamar', 'Hammerfest', 'Harstad', 'Haugesund', 'Hokksund', 'Holmestrand', 'Honningsvåg', 'Horten', 'Hønefoss', 'Jessheim', 'Jørpeland', 'Kirkenes', 'Kolvereid', 'Kongsberg', 'Kongsvinger', 'Kopervik', 'Kragerø', 'Kristiansand', 'Kristiansund', 'Langesund', 'Larvik', 'Leknes', 'Levanger', 'Lillehammer', 'Lillesand', 'Lillestrøm', 'Lyngdal', 'Mandal', 'Mo_i_Rana', 'Moelv', 'Molde', 'Mosjøen', 'Moss', 'Mysen', 'Måløy', 'Namsos', 'Narvik', 'Notodden', 'Odda', 'Orkanger', 'Oslo', 'Otta', 'Porsgrunn', 'Raufoss', 'Risør', 'Rjukan', 'Røros', 'Sandefjord', 'Sandnes', 'Sandnessjøen', 'Sandvika', 'Sarpsborg', 'Sauda', 'Ski_(tettsted
from PIL import Image
def convertBitmap(filename):
result = []
bitmap = Image.open(filename)
width = bitmap.width
height = bitmap.height
for y in range(0, height, 8):
for x in range(0, width):
col = 0
{
"language": "Norsk",
"startmenu.new_game": "NYTT SPILL",
"startmenu.multiplayer": "FLERSPILLER",
"startmenu.resume_game": "FORTSETT",
"startmenu.settings": "Innstillinger",
"startmenu.high_score": "Poengtavle",
"startmenu.throne_room": "Tronsal",
"startmenu.about": "Om",
"news.title": "Nyheter",
@Kyrremann
Kyrremann / sick.lua
Last active August 10, 2020 20:44
SICK: Simple Indicative of Competitive sKill - https://love2d.org/wiki/SICK
-- SICK: Simple Indicative of Competitive sKill
-- aka libhighscore
local h = {}
h.scores = {}
function h.set(filename, places, name, score)
h.filename = filename
h.places = places
if not h.load() then
h.scores = {}
@Kyrremann
Kyrremann / .travis.yml
Created January 16, 2019 21:28 — forked from willprice/.travis.yml
How to set up TravisCI for projects that push back to github
# Ruby is our language as asciidoctor is a ruby gem.
lang: ruby
before_install:
- sudo apt-get install pandoc
- gem install asciidoctor
script:
- make
after_success:
- .travis/push.sh
env:
@Kyrremann
Kyrremann / map_editor.pde
Created October 19, 2015 19:57
A simple map editor, using some of the images from Kenney Game Assets (http://kenney.itch.io/kenney-donation)
int TILE_SIZE = 64;
boolean DEBUG = false;
PImage tileImages[];
int tileIndex = 1;
int map[][];
PImage backgroundImage;
void setup() {
@Kyrremann
Kyrremann / EightBot.java
Created June 19, 2013 17:08
Eightbot A robot for RoboCode. Can you beat it? TODO * fix so we don't lose against wallbots * what to do when we spawn next to a robot?
/* -*- mode: java; compile-command: "javac -classpath /usr/share/java/robocode.jar EightBot.java; robocode -battle /home/simen/.robocode/battles/eightbot-vs-crazy.battle" -*- */
import robocode.*;
import java.util.*;
import java.awt.Color;
import static java.lang.Math.*;
public class EightBot extends AdvancedRobot {
final int TOLLERANCE = 10;
@Kyrremann
Kyrremann / Copyfile.bash
Created July 12, 2012 11:58
Copy and move files similar to copy/paste in a file manager
# copyfile
copyfile() {
local files="";
local path="$PWD";
for var in $@;
do
files="${files} ${path}/${var}";
done;
echo ${files} | xclip;
}