Skip to content

Instantly share code, notes, and snippets.

View chrisdempsey's full-sized avatar

Chris Dempsey chrisdempsey

View GitHub Profile
@rantastic
rantastic / vimeo_thumbnail.php
Last active October 3, 2017 11:32
PHP: Get Vimeo Thumbnail From Link
function video_image($url){
$image_url = parse_url($url);
$ch = curl_init('http://vimeo.com/api/v2/video/'.substr($image_url['path'], 1).'.php');
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
$a = curl_exec($ch);
$hash = unserialize($a);
return $hash[0]["thumbnail_medium"];
}
<?php
$output = '';
$tElementClass = !empty($tElementClass) ? $tElementClass : 'modSnippet';
$tStart = $modx->getMicroTime();
if (!empty($tElement)) {
switch ($tElementClass) {
case 'modChunk':
$output = $modx->getChunk($tElement, $scriptProperties);
break;
@mgirouard
mgirouard / destroy-sample-data.php
Created October 1, 2010 02:02
A quick hack to destroy all sample data in an OpenCart catalog.
<?php
$options = getopt('p:');
$prefix = empty($options['p'])
? realpath('.')
: realpath($options['p']);
if (empty($prefix)) {
die("Bad prefix. Try again.\n");
}