Skip to content

Instantly share code, notes, and snippets.

Avatar
🏴󠁧󠁢󠁷󠁬󠁳󠁿

Elliot Williams elliotwms

🏴󠁧󠁢󠁷󠁬󠁳󠁿
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@elliotwms
elliotwms / categories.json
Last active Oct 2, 2015
iTunes Podcast Categories
View categories.json
[
{
"category": "Arts",
"subcategories": [
"Design",
"Fashion & Beauty",
"Food",
"Literature",
"Performing Arts",
"Visual Arts"
View Emmetparty.txt
(h2+.table-responsive>table.table-bordered>thead>tr>th{Year}+th{Name}+th{Expires}^^+tbody>tr>td*3)*14
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">
</form>
<?php
if (count(array_unique($_POST['password'])) == 1) {
$password = $_POST['password'][0];
} else {
View youdeservearrays4.php
<?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
<?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
elliotwms / parse.py
Last active Aug 29, 2015
Parse a text file of websites into an SQL INSERT statement
View parse.py
#! /usr/bin/env python
f = open('output.sql', 'w');
f.write('INSERT INTO websites (url) VALUES\n')
for line in open("websites.txt",'r'):
f.write('(\''+line.strip()+'\'),\n')
f.close()
@elliotwms
elliotwms / gist:9249227
Last active Aug 29, 2015 — forked from Phrogz/gist:1290420
Feed The Beast Minecraft server as a service
View gist:9249227
#!/bin/bash
# /etc/init.d/minecraft
# version 0.3.4 2011-06-12 (YYYY-MM-DD)
### BEGIN INIT INFO
# Provides: minecraft
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Should-Start: $network
# Should-Stop: $network