Skip to content

Instantly share code, notes, and snippets.


Owen Garland bag-man

View GitHub Profile
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 / 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 = [
View C - Language Tests
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <pthread.h>
void end() {
printf("Game over.\n");
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 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
bag-man / cpu.js
Last active Apr 14, 2021
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