This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function HHMMSStoSeconds($time) { | |
return strtotime("1970-01-01 $time UTC"); | |
} | |
function secondsToHHMMSS($seconds) { | |
return sprintf("%02d%s%02d%s%02d", floor($seconds / 3600), ':', ($seconds / 60) % 60, ':', $seconds % 60); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function set_active($path) { | |
if (strpos(\Request::route()->getName(), $path) !== false) { | |
return 'active'; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
toHHMMSS(sec) { | |
let sec_num = parseInt(sec, 10); // don't forget the second parm | |
let hours = Math.floor(sec_num / 3600); | |
let minutes = Math.floor((sec_num - (hours * 3600)) / 60); | |
let seconds = sec_num - (hours * 3600) - (minutes * 60); | |
let Ohours = hours + ''; | |
let Ominutes = minutes + ''; | |
let Oseconds = seconds + ''; | |
if (hours < 10) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Turn a string ( like a username , into a RGB code (15e5de) , you can use this for styling purposes per user in chat examples | |
hashCode(str) { // java String#hashCode | |
var hash = 0; | |
for (var i = 0; i < str.length; i++) { | |
hash = str.charCodeAt(i) + ((hash << 5) - hash); | |
} | |
return hash; | |
}, | |
intToRGB(i){ | |
var c = (i & 0x00FFFFFF) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function _sendSlack($data) | |
{ | |
$webhook = 'INSERT WEBHOOK TOKEN HERE'; | |
// get celebrate gif | |
// http://api.giphy.com/v1/gifs/random?api_key=KEY&tag=party&limit=1 | |
$curl = curl_init(); | |
curl_setopt_array($curl, array( |
NewerOlder