Skip to content

Instantly share code, notes, and snippets.

Avatar

Owen Garland bag-man

View GitHub Profile
View Reversible.java
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++) {
@bag-man
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 = [
'http://www.bbc.co.uk/news/science-environment-31965456',
'http://news.sky.com/story/1448732/north-korea-defectors-are-human-scum',
'http://www.independent.co.uk/news/world/asia/north-korea-ready-anytime-for-nuclear-war-as-diplomat-calls-defectors-animals-and-scum-10121587.html',
'http://www.theguardian.com/education/2015/mar/20/labour-calls-time-on-exam-factory-approach-to-schooling',
'http://www.ft.com/cms/s/eb98baa4-ce49-11e4-86fc-00144feab7de,Authorised=false.html?_i_location=http%3A%2F%2Fwww.ft.com%2Fcms%2Fs%2F0%2Feb98baa4-ce49-11e4-86fc-00144feab7de.html%3Fsiteedition%3Duk&siteedition=uk&_i_referer=http%3A%2F%2Fwww.ft.com%2Fhome%2Fuk#axzz3Uv0Y2KoV',
'http://www.telegraph.co.uk/finance/economics/11484544/Europe-squeezes-more-reforms-from-Greece-as-Merkel-steps-into-bail-out-talks.html',
@bag-man
bag-man / owg1Snapper.java
Last active Aug 29, 2015
CS221 Assignment 2
View owg1Snapper.java
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
bag-man / template.tex
Last active Aug 29, 2015
LaTeX template
View template.tex
\documentclass[10pt]{article}
\usepackage{a4wide}
\usepackage[english]{babel}
\usepackage{fancyhdr}
\usepackage{hyperref}
\usepackage{lastpage}
\usepackage{graphicx}
\usepackage[section]{placeins}
\usepackage[superscript,biblabel]{cite}
\usepackage[margin=1in]{geometry}
@bag-man
bag-man / cv.html
Last active Aug 29, 2015
CV Viewer
View cv.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Owen Garland</title>
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<style>
.pdf {
width: 100%;
height: 100%;
View wpa_supplicant.conf
# /etc/wpa_supplicant/eduroam.conf
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=root
network={
ssid="eduroam"
scan_ssid=1
key_mgmt=WPA-EAP
eap=TTLS
identity="abc@aber.ac.uk"
View quicksort.py
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)
View UI-Rules.tex
\documentclass[10pt]{article}
\usepackage{a4wide}
\usepackage[english]{babel}
\usepackage{fancyhdr}
\usepackage{hyperref}
\usepackage{lastpage}
\usepackage{graphicx}
\usepackage[section]{placeins}
\usepackage[superscript,biblabel]{cite}
\usepackage[margin=1in]{geometry}
View Install Arch
loadkeys uk
wifi-menu
lsblk
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
bag-man / fugitive.patch
Created Feb 11, 2016
Improve status line formatting in vim-fugitive
View fugitive.patch
index a2cb700..2c44b3d 100644
--- a/plugin/fugitive.vim
+++ b/plugin/fugitive.vim
@@ -3012,7 +3012,7 @@ function! fugitive#statusline(...) abort
if &statusline =~# '%[MRHWY]' && &statusline !~# '%[mrhwy]'
return ',GIT'.status
else
- return '[Git'.status.']'
+ return ' '.status
endif
You can’t perform that action at this time.