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 searchTimeout = 0; | |
$("input[name='search']").on("keyup paste", function() { | |
clearTimeout(searchTimeout); | |
searchTimeout = setTimeout(function() { | |
var searchValue = $("input[name='search']").val().toLowerCase().trim(); | |
$("table tbody tr").addClass("d-none"); | |
$("table tbody").find("tr").each(function(i) { | |
if (~$(this).html().toLowerCase().trim().indexOf(searchValue)) { | |
$(this).removeClass("d-none"); | |
} |
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
$(document).ready(function() { | |
$("a[href^='#']").on("click", function(event) { | |
event.preventDefault(); | |
var target = this.hash, | |
$target = $(target); | |
$("html, body").stop().animate({ | |
"scrollTop": $target.offset().top | |
}, 900, "swing", function() { | |
window.location.hash = target; | |
}); |
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
$.ajax({ | |
url: "", | |
method: "GET", | |
data: { | |
}, | |
success: function(data) { | |
console.log(data); | |
}, | |
error: function(jqXHR, textStatus, errorThrown) { | |
console.log(jqXHR); |
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 | |
$mysqli = new mysqli($var["database"]["hostname"], $var["database"]["username"], $var["database"]["password"], $var["database"]["database"]); | |
if ($mysqli->connect_error) { | |
die("Connect Error (" . $mysqli->connect_errno . ") " . $mysqli->connect_error); | |
} | |
?> |
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
function compress($source, $destination, $quality) { | |
$info = getimagesize($source); | |
if ($info['mime'] == 'image/jpeg') { | |
$image = imagecreatefromjpeg($source); | |
} elseif ($info['mime'] == 'image/gif') { | |
$image = imagecreatefromgif($source); | |
} elseif ($info['mime'] == 'image/png') { | |
$image = imagecreatefrompng($source); | |
} | |
imagejpeg($image, $destination, $quality); |
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
using UnityEngine; | |
using UnityEngine.InputSystem; | |
public class Player : MonoBehaviour { | |
InputActions controls; | |
public float speed = 1f; | |
public float sensitivity = 1f; |
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
using UnityEngine; | |
using UnityEngine.InputSystem; | |
public class Player : MonoBehaviour { | |
InputActions controls; | |
public enum Perspective | |
{ | |
firstPerson, thirdPerson |
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
function uuid($data = null) { | |
$data = $data ?? random_bytes(16); | |
assert(strlen($data) == 16); | |
$data[6] = chr(ord($data[6]) & 0x0f | 0x40); | |
$data[8] = chr(ord($data[8]) & 0x3f | 0x80); | |
return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4)); | |
} |