Skip to content

Instantly share code, notes, and snippets.

View pamolloy's full-sized avatar

Philip Molloy pamolloy

View GitHub Profile
@pamolloy
pamolloy / post-update
Created April 1, 2014 14:53
`git submodule` commands cause `remote: fatal: Not a git repository: '.'`
#!/bin/bash
TMPDIR=$(mktemp --directory --quiet)
git clone $HOME/http $TMPDIR
cd $TMPDIR
git submodule init
git submodule update
jekyll &>/home/git/jekyll.log
rm -rf $TMPDIR
exit
@pamolloy
pamolloy / dhcp
Last active August 29, 2015 14:04
Router #2
config 'dnsmasq'
option 'domainneeded' '1'
option 'boguspriv' '1'
option 'filterwin2k' '0'
option 'localise_queries' '1'
option 'rebind_protection' '1'
option 'rebind_localhost' '1'
option 'local' '/lan/'
option 'domain' 'lan'
option 'expandhosts' '1'
@pamolloy
pamolloy / network
Created July 27, 2014 19:59
Router #1
config 'switch' 'eth0'
option 'enable' '1'
config 'switch_vlan' 'eth0_0'
option 'device' 'eth0'
option 'vlan' '0'
option 'ports' '1 2 3 5'
config 'switch_vlan' 'eth0_1'
option 'device' 'eth0'
, Option "V" ["variable"]
(ReqArg
(\arg opt -> do
let (key,val) = case break (`elem` ":=") arg of
(k,_:v) -> (k,v)
(k,_) -> (k,"true")
return opt{ optVariables = (key,val) : optVariables opt })
"KEY[:VALUE]")
""
@pamolloy
pamolloy / sts.bash
Created November 23, 2014 17:13
Bash commands executed by STS on my desktop while studying at GWU
boot
pwd
apt-get
apt
ifconfig
cd /proc
cd acpi
cd asus
cd embedded_controller/
cd scsi
@pamolloy
pamolloy / mls.json
Created October 31, 2011 22:19
A shortened output after crawling the official MLS Soccer Schedule
[
{
"date": "Friday, February 25, 2011",
"team1": "Columbus",
"team2": "Real Salt Lake",
"venue": "Columbus"
},
{
"date": "Tuesday, March 15, 2011",
"goals1": 0,
@pamolloy
pamolloy / wps.json
Created November 4, 2011 20:23
A shortened output after crawling the official WPS soccer schedule
[ [457/4959]
{
"attendance": "4,002",
"date": "Saturday, April 9, 2011",
"goals1": 1,
"goals2": 4,
"team1": "Atlanta Beat",
"team2": "Boston Breakers",
"venue": "KSU Soccer Stadium, Kennesaw, GA"
},
@pamolloy
pamolloy / gist:1348397
Created November 8, 2011 17:10
The output after crawling the official USSF schedule
[
{
"date": "Nov. 11, 2011",
"team1": "U.S. Men",
"team2": "France",
"time": "3 p.m. ET",
"tv0": "ESPN2",
"tv1": "ESPN3",
"tv2": "Univision",
"tv3": "Univision.com",
@pamolloy
pamolloy / gist:1364954
Created November 14, 2011 19:54
Project Euler problem 1 - A function for a generalized solution
def overlap(list):
"""Multiply each element by the following elements
in the list and return a list of each multiple"""
multiples = []
count = 0
for integer in list:
for index in range((count + 1), (len(list) - 1))
multiple = integer * list[index]
@pamolloy
pamolloy / 20120302-sorted.json
Created March 2, 2012 23:44
Sorted list of 2012 USSF and MLS matches as of March 2, 2012
[
{
"goals2": 2,
"goals1": 3,
"venue": "Central Broward Regional Park",
"team1": "Combine AdiPower",
"team2": "Combine Prime",
"date": "Friday, January 6, 2012"
},
{