Skip to content

Instantly share code, notes, and snippets.

@snorrewb
snorrewb / Sensor Array Hide Self.user.js
Last active December 21, 2015 20:29
Lets the user toggle visibility of owned fleets on http://www.war-facts.com/sensorArray.php*.
// ==UserScript==
// @name Sensor Array Hide Self
// @author Snorre Brechisen
// @description Lets the user toggle visibility of owned fleets.
// @version 0.95
// @include http://www.war-facts.com/sensorArray.php*
// @exclude http://www.war-facts.com/sensorArray.php?fleet*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js
// @grant GM_getValue
// @grant GM_setValue
@snorrewb
snorrewb / git_commands.java
Last active December 17, 2015 04:18
Git commands so I don't forget them. Only *.java for syntax highlighting.
// never use GitHub for Windows if you want to avoid losing all your code and most of your hair
// setup
git init // initialize folder for git repo
git remote add origin git@example.com:username/reponame.git // add repo to track
git branch -u origin/master // set upstream to origin master (no more "origin master" required after git pull/push
// alternatively
git push --set-upstream origin master
// check status of local repo
@snorrewb
snorrewb / algmet_oblig4.cpp
Created September 5, 2012 14:55
IMT2021 Algoritmiske Metoder - Obligatorisk oppgave 4
/** Algmet Oblig 4
* Snorre Brecheisen (******)
* 10HBSPA
*************************************/
/** INCLUDES **/
#include <fstream>
#include <iostream>
using namespace std;
/** CLASSES/NODES **/
struct node {
@snorrewb
snorrewb / ooprog_oblig3.cpp
Created September 5, 2012 14:54
IMT1082 Objekt-Orientert Programmering - Obligatorisk oppgave 2 eller 3
/** Oblig 2
* Objekt-orientert Programmering
* Snorre Brecheisen (******)
* Spillprogrammering
********************************/
/** INCLUDES **/
#include <cstring>
#include <cctype>
#include <fstream>
@snorrewb
snorrewb / grprog_oblig5.cpp
Created September 5, 2012 14:50
IMT1031 Grunnleggende Programmering - Obligatorisk oppgave 5
// Program for å administrere telefonnumre (og adresser) for ulike
// kontakter/familie/venner.
// INCLUDE:
#include <fstream> // ifstream
#include <iostream> // cout, cin
#include <cctype> // toupper
#include <cstring> // strcmp, strlen
using namespace std;
@snorrewb
snorrewb / grprog_oblig3.cpp
Created September 5, 2012 14:49
IMT1031 Grunnleggende Programmering - Obligatorisk oppgave 3
#include <iostream>
using namespace std;
//pre-declare methods used in the program
int menu ();
bool legal (int distance);
void race (int distance, int lap);
bool rerun ();
float timeToFloat (int m, int s, int h);
void floatToTime (float h);
@snorrewb
snorrewb / grprog_oblig2.cpp
Created September 5, 2012 14:48
IMT1031 Grunnleggende Programmering - Obligatorisk oppgave 2
#include <iostream>
using namespace std;
int main () {
//declare variables
const int maxTemp = 70; //maximum allowed temperature
const int minTemp = -70; //minimum allowed temperature
const int maxRain = 200; //maximum allowed downpour
const int minRain = 0; //minimum allowed downpour
char again = 'Y'; //variable for knowing when to shut down