Skip to content

Instantly share code, notes, and snippets.

View mtNATS's full-sized avatar
:octocat:
(isset($brain))?:die;

Mitrofan Kaufman mtNATS

:octocat:
(isset($brain))?:die;
View GitHub Profile
@mtNATS
mtNATS / content_type_json.php
Created September 17, 2019 06:46 — forked from mironal/content_type_json.php
header("Content-type: application/json; charset=utf-8"); php
<?php
header("Content-type: application/json; charset=utf-8");
/* something... */
?>
@mtNATS
mtNATS / index.html
Created September 7, 2019 02:54
Roulette test
<div class="nav">
<div class="holder">
SIMPLE ROULETTE
<div id="bal" style="float: right"></div>
</div>
</div>
<div class="holder">
<div id="out">NUMBER</div>
<div class="roulette">
<div class="timer" id="timer"></div>
@mtNATS
mtNATS / date_sort.php
Created May 20, 2019 10:57
php: sort multi-dimensional array by date value
function dt_sort_up($a, $b){
if ($a['dt'] == $b['dt']) return 0;
return (strtotime($a['dt']) < strtotime($b['dt'])) ? -1 : 1;
}
function dt_sort_down($a, $b){
if ($a['dt'] == $b['dt']) return 0;
return (strtotime($a['dt']) > strtotime($b['dt'])) ? -1 : 1;
}