Skip to content

Instantly share code, notes, and snippets.

@stathisg
stathisg / LogoResizer.php
Created May 10, 2015 12:42
Code for "How to resize a logo to specific dimensions keeping its aspect ratio using PHP" tutorial published at http://burnmind.com/tutorials/resize-logo-keeping-aspect-ratio
<?php
namespace LogoResizer;
use Intervention\Image\ImageManagerStatic as Image;
class LogoResizer {
private $desired_width;
private $desired_height;
private $desired_aspect_ratio;
@stathisg
stathisg / phaser-restrict-drag.html
Last active April 17, 2017 16:10
Code for "How to restrict the drag movement of a sprite to both X & Y axis in Phaser" tutorial published at http://burnmind.com/tutorials/drag-sprite-horizontally-vertically-phaser
<!DOCTYPE html>
<html lang="en">
<head>
<title>Animals</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script type="text/javascript" src="phaser.min.js"></script>
<script type="text/javascript" src="square.js"></script>
<style>
@stathisg
stathisg / query_profiles
Last active August 29, 2015 14:04
Profiling the performance of a few queries (based on the following discussion: http://www.freestuff.gr/forums/viewtopic.php?t=68286)
<?php
set_time_limit(0);
$db_host = ''; //Database hostname
$db_username = ''; //Database username
$db_password = ''; //Database password
$db_name = ''; //Database name
$db_table_name = ''; //Database table name
function create_table() {