This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Two directories: | |
/public -> For publically accessible files | |
/templates -> For templated code, not publically accessible | |
Make pages in /public which have database/$_GET/etc. code in them (business logic/controller logic). At the end of them do: | |
$contentPath = __DIR__ . "/../templates/index.php"; | |
require __DIR__ . "/../templates/layout.php"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HAI | |
BTW The UPSU:Radio website, rewritten in LOLCODE | |
CAN HAS STDIO? | |
GIMMEH REQUEST | |
VISIBLE "UPSU:RADIO" | |
I HAS A COUNTER BTW Incrementer for the nav loop |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
""" | |
Imports two exported CSV files containing tabular data, merges them and | |
outputs the difference between one list and the merged copy. | |
""" | |
import csv | |
# Import |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A couple of CSS rules to achieve equal-height columns in Blueprint CSS | |
*/ | |
/* Apply to the sub-grid container */ | |
.equalcolumns { | |
overflow: hidden; | |
} | |
/* Note column classes must start with their span-x attribute */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For when Ubuntu crashes out and you need to backup from a live CD. | |
Source: http://ubuntuforums.org/showthread.php?t=1534704 | |
1. Locate the ubuntu filesystem in /media, it'll have a name like /media/8805834782... - it's UUID. | |
2. If the dir isn't encrypted you'll be able to browse /media/UUID/home/user/*, otherwise it'll have two files about ecryptfs - follow to the next step. | |
3. If the dir is encrypted you'll need to mount it - for this you will need the passphrase and filename encryption key signature: | |
4. First add the passphrase (see 4a if you don't know it): | |
$ sudo ecryptfs-add-passphrase --fnek | |
Passphrase: <enter passphrase> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$array = array( | |
array("id" => 1, "user" => "Ross"), | |
array("id" => 2, "user" => "Adam"), | |
array("id" => 3, "user" => "Ben") | |
); | |
$iterator = new RecursiveArrayIterator($array); | |
foreach ($iterator as $key => $value) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://scratchedguitar.dyndns.org:8000/listen |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Secret santa matching attempt | |
""" | |
import random | |
""" | |
Match people randomly to others, for example in a secret santa | |
Takes a list of people as an input and returns a list of tuples (person a sending to person b) | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Model_Question extends WebApp_Model | |
{ | |
protected $id; | |
protected $question; | |
protected $choices = array(); | |
protected $asker; | |
protected $asked; | |
protected $visible = true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Model_Question extends WebApp_Model | |
{ | |
protected $id; | |
protected $question; | |
protected $choices = array(); | |
protected $asker; | |
protected $asked; | |
protected $visible = true; |