Skip to content

Instantly share code, notes, and snippets.

{
"device_id": "c848c76c0052e42fd3556c4ba0e45437c8ac9310",
"commpany_id": "15eb88f79dcbea27e8c6d6429e61dd4391b86736",
"slug_sha1": "a3208dff4ea054ee4a817a4fbdbbae758f79bdfb",
"defi_minigame_id": "bea4c245-cf0b-11ed-8253-06ef48dfd670",
"values": {
"select-1680197906194-0": {
"label": "Entité",
"type": "select-one",
"value": "it"
@kameltovic
kameltovic / select.php
Last active September 26, 2021 19:39
[Select mysqli] #php
$sql = "SELECT ";
$res = $mysqli->query($sql) or die($mysqli->error);
$arr = array();
while($data = $res->fetch_assoc()){
array_push($arr, $data);
}
@kameltovic
kameltovic / ajaxupload.html
Last active November 2, 2022 17:18
Upload files through Ajax without jquery
<form action="" enctype="multipart/form-data" id="file-form" method="POST">
<div id="upup">
<h2>Upload update file</h2>
<p id="progressdiv"><progress max="100" value="0" id="progress" style="display: none;"></progress></p>
<input type="file" name="file-select" id="file-select">
<button type="submit" id="upload-button">Upload</button>
</div>
</form>
<script type="text/javascript">
var form = document.getElementById('file-form');
@kameltovic
kameltovic / gist:7088717
Created October 21, 2013 18:37
Detect UTF8 with PHP

###Detecter l'UTF8 en PHP###

function detectUTF8($string){
        return preg_match('%(?:
        [\xC2-\xDF][\x80-\xBF]        # non-overlong 2-byte
        |\xE0[\xA0-\xBF][\x80-\xBF]               # excluding overlongs
 |[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2} # straight 3-byte
@kameltovic
kameltovic / changeurl
Created June 24, 2013 22:25
Change URL with javascript
window.history.pushState("object or string", "Title", "/new-url");
@kameltovic
kameltovic / gist:5280423
Created March 31, 2013 12:12
Do not include jquery twice anymore
<script>
if (typeof jQuery == 'undefined') {
document.write('\x3Cscript type="text/javascript" src="http://code.jquery.com/jquery-latest.js">\x3C/script>');
}
</script>
@kameltovic
kameltovic / retina
Created September 1, 2012 23:32 — forked from elimc/gist:3558868
Retina CSS example
@media only screen and (-moz-min-device-pixel-ratio: 1.5),
only screen and (-webkit-min-device-pixel-ratio: 1.5),
only screen and (min-device-pixel-ratio: 1.5)
{
#test {
background: url(../images/test@2.png) no-repeat center center;
-webkit-background-size: 25px 25px;
-moz-background-size: 25px 25px;
background-size: 25px 25px;
)