Skip to content

Instantly share code, notes, and snippets.

View NickGeek's full-sized avatar

Nick Webster NickGeek

View GitHub Profile
state([], [], _).
%% Basically these facts are our valid moves because we can always move to an empty state.
move(state([H|T], [], S3), state(T, [H], S3)).
move(state([H|T], S2, []), state(T, S2, [H])).
move(state(S1, [H|T], []), state(S1, T, [H])).
move(state([], [H|T], S3), state([H], T, S3)).
move(state([], S2, [H|T]), state([H], S2, T)).
#!/bin/python3
import os
print("AVD Launcher with replaced libs\nBy Nick Webster http://nick.geek.nz\n====================\n")
print("Note: You should be in your Android SDK tools folder when running this script.")
AVDs = [file.split('.')[0] for file in os.listdir(os.path.expanduser('~/.android/avd/')) if file.split('.')[len(file.split('.'))-1] == 'ini']
i = 0
for avd in AVDs:
@NickGeek
NickGeek / ballCounter.py
Last active December 8, 2015 05:09
I made a Python script for the ball counting problem in this video https://www.youtube.com/watch?v=ffUnNaQTfZE
urn = []
i = 0
tmpI = 0
started = False
while 1:
if started:
del urn[0]
for j in range(10):
started = True
urn.append(i+(j+1))
@NickGeek
NickGeek / ppapt.py
Last active January 1, 2016 10:09
Install packages from most PPA's (via launchpad) on Debian and other Debian based distros. This won't work for everything as some packages require Ubuntu specific dependencies but it's always worth a try.NOTE: If the PPA you are downloading from has more than one package, this will download the latest one.
#!/usr/bin/python2.7
#Install packages from most PPA's (via launchpad) on Debian and other Debian based distros.
#Usage:
#./ppapt ppa:user/package
#NOTE: This is written for Python 2.7.5. Feel free to run it on older/newer versions but don't expect stuff to work
#Imports
import os, sys, urllib2