I hereby claim:
- I am jasonbradley on github.
- I am jasonbradley (https://keybase.io/jasonbradley) on keybase.
- I have a public key whose fingerprint is 66A3 8B66 955C E77B 5DAF 30CA 0F7E ABE6 63EE B093
To claim this, I am signing this object:
| <?php | |
| function isNextDateGreaterThanHalf($frequency, $seasonalEndDate, $nextDate) | |
| { | |
| $dateDiff = (strtotime($seasonalEndDate) > strtotime($nextDate)) | |
| ? strtotime($seasonalEndDate) - strtotime($nextDate) | |
| : strtotime($nextDate) - strtotime($seasonalEndDate); | |
| $daysDiff = floor($dateDiff / (60*60*24)); //seconds * mins in hour * hours in day |
| #!/bin/bash | |
| PHPUNIT_COMMAND="" | |
| MEMORY_LIMIT=512M | |
| PHPUNIT_VERSION="4.1.3" | |
| if hash phpunit 2>/dev/null; | |
| then | |
| PHPUNIT_COMMAND="phpunit" | |
| elif [ -e phpunit.phar ] |
| ## install subversion 1.7.x ## | |
| wget http://pkgs.repoforge.org/subversion/subversion-1.7.1-0.1.el6.rfx.x86_64.rpm /tmp | |
| sudo rpm -ivh /tmp/subversion-1.7.1-0.1.el6.rfx.x86_64.rpm |
I hereby claim:
To claim this, I am signing this object:
| function Util:hex2rgb(hex) | |
| hex = hex:gsub("#","") | |
| return tonumber("0x"..hex:sub(1,2)), tonumber("0x"..hex:sub(3,4)), tonumber("0x"..hex:sub(5,6)) | |
| end |
| -- load the JSON library. | |
| local Json = require("json") | |
| local JsonStorage = {} | |
| -- Function to save a table. Since game settings need to be saved from session to session, we will | |
| -- use the Documents Directory | |
| JsonStorage.saveTable = function(t, filename) | |
| local path = system.pathForFile( filename, system.DocumentsDirectory) | |
| local file = io.open(path, "w") |
| Util.format_num = function(amount, decimal, prefix, neg_prefix) | |
| local str_amount, formatted, famount, remain | |
| decimal = decimal or 2 -- default 2 decimal places | |
| neg_prefix = neg_prefix or "-" -- default negative sign | |
| famount = math.abs(Util.round(amount,decimal)) | |
| famount = math.floor(famount) | |
| remain = Util.round(math.abs(amount) - famount, decimal) |
| Util.round = function(num, idp) | |
| local mult = 10^(idp or 0) | |
| return math.floor(num * mult + 0.5) / mult | |
| end |
| Util.trim = function(s) | |
| return (string.gsub(s, "^%s*(.-)%s*$", "%1")) | |
| end |