Skip to content

Instantly share code, notes, and snippets.

Avatar
🌏
👍🏼💯🚀🙌🥂🎈🎂🎉🍟🍔🥓🥝🍇🚲🛵🪂🚤🌋🗻🏞💈🌊

Ayesh Karunaratne Ayesh

🌏
👍🏼💯🚀🙌🥂🎈🎂🎉🍟🍔🥓🥝🍇🚲🛵🪂🚤🌋🗻🏞💈🌊
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am ayesh on github.
  • I am ayesh (https://keybase.io/ayesh) on keybase.
  • I have a public key ASDeCBZ3Gd198xEnKmcpHKk4ZrsHxyRXkzoKqT-HyDqGsAo

To claim this, I am signing this object:

View gist:19c8dc55acd4ff511904dfb0d0bc6033
### Keybase proof
I hereby claim:
* I am Ayesh on github.
* I am ayesh (https://keybase.io/ayesh) on keybase.
* I have a public key whose fingerprint is 1083 D261 72E3 855D 4F0A A4D6 0A85 2BB5 2939 C224
To claim this, I am signing this object:
@Ayesh
Ayesh / gist:e949642860a01c350b29
Created Mar 14, 2015
Generate an array of random integers that averages (or closes) to a given float or integer
View gist:e949642860a01c350b29
<?php
function getRandomintegersFloatAvg($target, $count, $min = 1, $max = 5, $precision = 2) {
if ($target > $max) return FALSE;
if ($target < $min) return FALSE;
if ($count < 1) return FALSE;
if ($count === 1) return array(round($target));
$values = array();
for ($i = 0; $i < $count; $i++) {
$values[] = mt_rand($min, $max);
You can’t perform that action at this time.