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
git svn clone https://tuxxedo.googlecode.com/svn tuxx // check url | |
cd tuxx | |
git remote add origin $GITHUB_URL | |
git push origin |
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 | |
$conn = new MySQLi("localhost", "root", "password", "widget_corp"); | |
if ($conn->connect_errno()) { | |
die("Failed to connect: " . $conn->connect_error()); | |
} | |
$result = $conn->query("SELECT * FROM subjects"); | |
// You wouldn't usually have this, as you only get an error if the sql's | |
// wrong |
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; |
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
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
<?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
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
/** | |
* 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
#!/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 |