I hereby claim:
- I am kirsty-forrester on github.
- I am frostyswirl (https://keybase.io/frostyswirl) on keybase.
- I have a public key ASDaoU7yQs6yAxJNFJD5t1GVF6dglt1Wu7CK6s8vpOlI9wo
To claim this, I am signing this object:
const https = require('https'); | |
// Convert degrees to radians | |
const toRad = x => x * Math.PI / 180; | |
/** | |
* Calculate the distance between two sets of coordinates | |
* | |
* @param {array} [coords1] The first set of coordinates, in degrees | |
* @param {array} [coords2] The first set of coordinates, in degrees |
/** | |
* Deep clone an object | |
* Designed to handle objects with objects, arrays, and dates | |
* TODO: Handle other data types? | |
* | |
* @param {object} [obj] The object to clone | |
* @return {object} The cloned object | |
*/ | |
const deepClone = (obj) => { |
I hereby claim:
To claim this, I am signing this object:
<?php | |
function trimTiled($imageFile) | |
{ | |
// Get image and its dimensions | |
$image = new Imagick($imageFile); | |
list($width, $height, $type, $attr) = getimagesize($imageFile); | |
/** | |
* Create a new image that has the same dimensions as the original image |
<?php | |
function getPalette($imageFile) | |
{ | |
$image = new Imagick($imageFile); | |
$pixels = $image->getImageHistogram(); | |
$palette = array(); | |
foreach($pixels as $p){ | |
// Below gives us an array in the format ('r' => 44, 'g' => 43, 'b' => 44, 'a' => 1) | |
$colors = $p->getColor(); |