This file contains 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( |
This file contains 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 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 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 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 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
public toSeconds(time) { | |
var parts = time.split(':'); | |
return (+parts[0]) * 60 * 60 + (+parts[1]) * 60 + (+parts[2]); | |
} |
This file contains 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 | |
$array1 = ['Rocket','Thruster','Space']; | |
$array2 = ['Rocket','Rocks','Space']; | |
$collection = collect($array1); | |
$intersect = $collection->intersect($array2); | |
var_dump($intersect ) | |
// $intersect = ['Rocket','Space']; |
This file contains 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 | |
$this->notification('Nieuw bericht', 'Er is een nieuw bericht :ghost:', config('slack.color'), | |
[ | |
'title' => "Veld 1", | |
'value' => 'Dingen', | |
'short' => true, | |
], [ | |
'title' => "Veld 2", | |
'value' => 'Nog meer dingen', |
This file contains 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
#!/bin/bash | |
export var=`valet fetch-share-url` | |
sed -i -e "s@.*APP_URL.*@APP_URL=$var@" $result | |
echo "💪 - Valet share URL has been replaced 📋 " |
This file contains 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
var change = 0; | |
var simultanius = 0; | |
var que = 1000; // number of tests | |
Array(que).join(0).split(0).forEach(function(a,i){ | |
var xhr = new XMLHttpRequest; | |
xhr.open("GET",'/?' + i); // cacheBust | |
xhr.onreadystatechange = function() { | |
if(xhr.readyState == 2){ |
OlderNewer