Skip to content

Instantly share code, notes, and snippets.


Elliot Williams elliotwms

View GitHub Profile

Keybase proof

I hereby claim:

To claim this, I am signing this object:

elliotwms / categories.json
Last active Oct 2, 2015
iTunes Podcast Categories
View categories.json
"category": "Arts",
"subcategories": [
"Fashion & Beauty",
"Performing Arts",
"Visual Arts"
View Emmetparty.txt
View youdeservearrays5.php
<form id="youdeservearrays" action="index.php" method="post">
<input type="password" name="password[1]" value="Hello World">
<input type="password" name="password[2]" value="Hello Qorld">
if (count(array_unique($_POST['password'])) == 1) {
$password = $_POST['password'][0];
} else {
View youdeservearrays4.php
$options = $_POST['options'];
// Now you can work with this just like an array!
foreach ($options as $option => $value)
echo "Option " . $option . " = " . $value . "!";
View youdeservearrays3.php
<input type="checkbox" name="options[a]" value="">
<input type="checkbox" name="options[b]" value="">
<input type="checkbox" name="options[c]" value="">
<input type="checkbox" name="options[d]" value="">
<input type="checkbox" name="options[e]" value="">
View youdeservearrays2.php
// Long winded...
$option_a = $_POST['option_a'];
$option_b = $_POST['option_b'];
$option_c = $_POST['option_c'];
$option_d = $_POST['option_d'];
$option_e = $_POST['option_e'];
// Slightly better...
$options = [
View youdeservearrays1.php
<input type="checkbox" name="option_a" value="">
<input type="checkbox" name="option_b" value="">
<input type="checkbox" name="option_c" value="">
<input type="checkbox" name="option_d" value="">
<input type="checkbox" name="option_e" value="">
elliotwms /
Last active Aug 29, 2015
Parse a text file of websites into an SQL INSERT statement
#! /usr/bin/env python
f = open('output.sql', 'w');
f.write('INSERT INTO websites (url) VALUES\n')
for line in open("websites.txt",'r'):
elliotwms / gist:9249227
Last active Aug 29, 2015 — forked from Phrogz/gist:1290420
Feed The Beast Minecraft server as a service
View gist:9249227
# /etc/init.d/minecraft
# version 0.3.4 2011-06-12 (YYYY-MM-DD)
# Provides: minecraft
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Should-Start: $network
# Should-Stop: $network