Skip to content

Instantly share code, notes, and snippets.

@Lammerink
Lammerink / gist:3925132
Last active September 2, 2016 11:36
PHP : Generated in X Seconds
<?php
//Generated in X Seconds Helper
//Put this at the top of the script
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$start = $time;
?>
@Lammerink
Lammerink / gist:3925263
Created October 20, 2012 23:42
PHP : Get Biggest image from URL
<?php
// Don't forget to install URL_to_Absolute
// Found at http://www.electrictoolbox.com/examples/url_to_absolute.zip
function get_biggest_img($url){
require_once('simple_html_dom.php'); // PHP Simple HTML DOM Parser.
require_once('url_to_absolute/url_to_absolute.php'); // get image absolute url.
// options
$biggestImage = 'path to "no image found" image'; // Is returned when no images are found.
@Lammerink
Lammerink / CSS : Web Font Stacks.css
Last active April 5, 2018 13:10
CSS : Web Font Stacks
@charset "UTF-8";
/* Web Font stacks */
/* The Times New Roman-based serif stack: */
font-family: Cambria, "Hoefler Text", Utopia, "Liberation Serif", "Nimbus Roman No9 L Regular", Times, "Times New Roman", serif;
/* A modern Georgia-based serif stack:*/
font-family: Constantia, "Lucida Bright", Lucidabright, "Lucida Serif", Lucida, "DejaVu Serif," "Bitstream Vera Serif", "Liberation Serif", Georgia, serif;
/*A more traditional Garamond-based serif stack:*/
@Lammerink
Lammerink / gist:3925106
Created October 20, 2012 22:49
PHP : Image Resize and Crop Using ImageMagick
<?php
// Image Resize and Crop using ImageMagick
// the Function
//imageresize to Thumb
function imageresize($src,$dest,$size=75){
list($w,$h) = getimagesize($src);
if($w > $h){
@Lammerink
Lammerink / imagemagick.php
Last active July 3, 2019 10:45
PHP : Verify if ImageMagick is Installed
<?
/*
// This file will run a test on your server to determine the location and versions of ImageMagick.
//It will look in the most commonly found locations. The last two are where most popular hosts (including "Godaddy") install ImageMagick.
//
// Upload this script to your server and run it for a breakdown of where ImageMagick is.
//
*/
echo '<h2>Test for versions and locations of ImageMagick</h2>';
echo '<b>Path: </b> convert<br>';