Skip to content

Instantly share code, notes, and snippets.

View RolandWarburton's full-sized avatar
🍃

Roland RolandWarburton

🍃
View GitHub Profile

test gist

@RolandWarburton
RolandWarburton / TNE10006_case_study_notes.txt
Created May 16, 2019 07:14
some useful commands for the case study
conf t
spanning-tree vlan 1 root primary
vlan 468
name Carpentry
exit
int vlan 468
no ip address
exit
@RolandWarburton
RolandWarburton / draw_gosu_text.txt
Created May 16, 2019 23:52
how to draw text in gosu
require 'gosu'
class GosuWindow < Gosu::Window
def initialize
super 640, 480, false
self.caption = "gosu"
@font = Gosu::Font.new(self, Gosu::default_font_name, 20)
end
@RolandWarburton
RolandWarburton / backup.sh
Last active June 1, 2019 12:34
backup linux rsync
sudo rsync -aAXv --delete --exclude=/dev/* --exclude=/proc/* --exclude=/sys/* --exclude=/tmp/* --exclude=/run/* --exclude=/mnt/* --exclude=/media/* --exclude="swapfile" --exclude="lost+found" --exclude=".cache" --exclude="Downloads" --exclude=".ecryptfs" /source /destination
@RolandWarburton
RolandWarburton / index.js
Created July 17, 2019 11:01
xmlhttprequest simple setup
window.onload = function() {
console.log('loaded');
const url = './file.txt';
// make a new 'request'.
// request is an object so we use the keyword 'new' to make an instance of the XMLHttpRequest object
var request = new XMLHttpRequest();
// GET data from a location
request.open('GET', url);
// prevent caching so when you reload it gets the data again
@RolandWarburton
RolandWarburton / calcPlaytime.py
Created August 5, 2019 23:46
calculates total playtime from minecraft stats json data
#!/usr/bin/python3
import os
import json
__author__ = "Roland"
__version__ = "1.0.1"
def main():
# where to look for stats files
public Rectangle() : base(10, 10, 10, 10, SwinGame.ColorAliceBlue())
{
}
public Rectangle(Color color) : this(10, 10, 10, 10, color)
{
Rectangle otherrect = new Rectangle();
}
@RolandWarburton
RolandWarburton / SWE20004_assign1_encoder.cpp
Created September 6, 2019 01:08
SWE20004 assignment 1 encoder
void encode4PlusDigits(int value)
{
// slices an int number. eg.
// a[1,2,3] = a[1] = 2
int valueLen = to_string(value).length();
int sliced[valueLen];
for (int i = 0; i < valueLen; i++)
{
sliced[i] = value % 10;
value /= 10;
@RolandWarburton
RolandWarburton / cpp_fcnptr.cpp
Last active September 6, 2019 08:04
c++ function pointers
#include <iostream>
#include <iomanip>
#include <string>
#include <array>
#include <algorithm>
#include <vector>
using namespace std;
@RolandWarburton
RolandWarburton / maps.cpp
Created September 22, 2019 00:15
c++ maps basics
#include <iostream>
#include <map>
using namespace std;
int main(int argc, char const *argv[])
{
map<string, int> mymap;
mymap.insert({"hello", 1});
mymap.insert({"world", 1});