Monthly Archives: September 2012

You are browsing the site archives by month.

Cards Against Humanity – All-White/Ink-Saver Edition

As you probably already know, Cards Against Humanity is an awesome card game. Unfortunately it’s also sold out here in Canada.

I decided to make an all-white set because I wanted to print a set at home while not using tons of ink. It was made by inverting the “black” card pages in photoshop. I scribbled on the backs of the “black” cards once printed with a marker to make them easier to differentiate from the “white” cards while playing.

You can download the all-white set here.

Credits for the original file go to Cards Against Humanity.

A Simple Server-to-Server File Transfer Script (PHP)

I’ve used this little script quite a bit while moving servers, and it’s saved me tons of time. It allows you to transfer large files from one server to another by breaking up the file into 1MB pieces to avoid memory limits. There seems to be a 2GB maximum on transfer sizes.

To use it, simply change the variable $path to a relative path on your new server where you want the file to be saved to, change the variable $url to the web-accessible location of the file on the old server, and upload and run the script on your new server.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
set_time_limit(0); //Unlimited max execution time
 
$path = 'newfile.zip';
$url = 'http://example.com/oldfile.zip';
$newfname = $path;
echo 'Starting Download!<br>';
$file = fopen ($url, "rb");
if($file) {
	$newf = fopen ($newfname, "wb");
	if($newf)
		while(!feof($file)) {
			fwrite($newf, fread($file, 1024 * 8 ), 1024 * 8 );
			echo '1 MB File Chunk Written!<br>';
		}
}
if($file) {
	fclose($file);
}
if($newf) {
	fclose($newf);
}
echo 'Finished!';
?>