Skip to content

Instantly share code, notes, and snippets.

View rrrhys's full-sized avatar

Rhys Williams rrrhys

View GitHub Profile
<?php // You need to add server side validation and better error handling here
$data = array();
if(isset($_FILES))
{
$error = false;
$files = array();
$uploaddir = './uploads/';
@rrrhys
rrrhys / Create Screenshot of supplied CSS selector
Created April 20, 2012 07:01 — forked from n1k0/gist:1501173
PhantomJS: Capturing single dom elements as png files
var page = new WebPage(),
address, output, size;
var retval = {};
retval.result = "failed";
retval.messages = [];
//capture and captureSelector functions adapted from CasperJS - https://github.com/n1k0/casperjs
capture = function(targetFile, clipRect) {
try {