Skip to content

Instantly share code, notes, and snippets.

Owen Garland bag-man

Block or report user

Report or block bag-man

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
bag-man / cpu.js
Last active Nov 8, 2019
How to calculate the current CPU load with Node.js; without using any external modules or OS specific calls.
View cpu.js
var os = require("os");
//Create function to get CPU information
function cpuAverage() {
//Initialise sum of idle and time of cores and fetch CPU info
var totalIdle = 0, totalTick = 0;
var cpus = os.cpus();
//Loop through CPU cores
View Install Arch
loadkeys uk
cgdisk /dev/sda #100M EF01 boot
cryptsetup -y -v luksFormat /dev/sdaX
cryptsetup open /dev/sdaX cryptroot
mkfs -t ext4 /dev/mapper/cryptroot
mount -t ext4 /dev/mapper/cryptroot /mnt
mkfs -t ext4 /dev/sdaY
mkdir /mnt/boot
import java.util.ArrayList;
public class Reversible implements IReversible {
public ArrayList<Integer> listReversible(int upperLimit) {
ArrayList<Integer> list = new ArrayList();
for(int i = 0; i < upperLimit; i++) {
View C - Language Tests
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <pthread.h>
void end() {
printf("Game over.\n");
bag-man / JuicerURLTester.js
Created Mar 20, 2015
[Node.js] Test if a URL is on juicer
View JuicerURLTester.js
var crypto = require('crypto');
var http = require('http');
var JUICER_API_KEY = "YB0MY3VMHyllzPqEf5alVj5bUvGpvDVi";
var urls = [
bag-man /
Last active Aug 29, 2015
CS221 Assignment 2
package cs21120.assignment2.solution;
import cs21120.assignment2.FloatImage;
import cs21120.assignment2.ISnapper;
import java.util.concurrent.PriorityBlockingQueue;
import java.util.LinkedList;
import java.awt.Point;
bag-man / template.tex
Last active Aug 29, 2015
LaTeX template
View template.tex
bag-man / cv.html
Last active Aug 29, 2015
CV Viewer
View cv.html
<!DOCTYPE html>
<meta charset="UTF-8">
<title>Owen Garland</title>
<link rel="icon" type="image/x-icon" href="favicon.ico" />
.pdf {
width: 100%;
height: 100%;
View wpa_supplicant.conf
# /etc/wpa_supplicant/eduroam.conf
def quicksort(arr):
if not arr:
return []
pivot = arr[-1]
less = [x for x in arr[:-1] if x <= pivot]
more = [x for x in arr[:-1] if x > pivot]
lesser = quicksort(less)
greater = quicksort(more)
You can’t perform that action at this time.