Skip to content

Instantly share code, notes, and snippets.

{
init: function(elevators, floors) {
Array.prototype.getMaxValue = function() {
return Math.max.apply(null, this);
};
Array.prototype.getMinValue = function() {
return Math.min.apply(null, this);
};
Array.prototype.removeValue = function(what) {
while ((ax = this.indexOf(what)) !== -1) {
@vibby
vibby / login.html
Last active December 20, 2016 16:47
A simple login page : tiny, good feeling and resonsive
<!doctype html>
<html class="no-js" lang="fr">
<head>
<meta charset="UTF-8">
<title>Authentification Vibby</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
* { box-sizing:border-box; }
html, body { margin: 0; padding: 0; }
body {
@vibby
vibby / session.php
Created December 20, 2016 16:38
check session availability in PHP
<?php
session_start();
$sessPath = ini_get('session.save_path');
$sessCookie = ini_get('session.cookie_path');
$sessName = ini_get('session.name');
$sessVar = 'foo';
$essValue = 'hello world';
<?php
$minlength = 6; // Must be a multiple of 2 !! So 14 will work, 15 won't, 16 will, 17 won't and so on
$maxlength = 10;
$nb = 100;
function addChar(array $list) {
$add = $list[rand(0, count($list)-1)];
if (rand(0,1)) {
@vibby
vibby / dabblet.css
Created February 18, 2016 18:55
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
html::after { background: rgba(0, 0, 0, .8); background: -moz-linear-gradient(top, #911 0%, #911 31%, Gold 32%, Gold 49%, RoyalBlue 50%, RoyalBlue 70%, OliveDrab 71%, OliveDrab 100%); background: -webkit-linear-gradient(top, #911 0%,#911 31%,Gold 32%,Gold 49%,RoyalBlue 50%,RoyalBlue 70%,OliveDrab 71%,OliveDrab 100%); background: linear-gradient(to bottom, #911 0%,#911 31%,Gold 32%,Gold 49%,RoyalBlue 50%,RoyalBlue 70%,OliveDrab 71%,OliveDrab 100%); border: 5px solid #fff; border-radius: 5px; bottom: 1em; box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .3); color: #fff; content: "Erreurs" ": " counter(error) "\a" "Avertissements" ": " counter(warning) "\a" "Obsolètes" ": " counter(obsolete) "\a" "Conseils" ": " counter(advice); font: 700 1.2rem/1.5 "Arial", "Nimbus Sans L", sans-serif; left: 1em; padding: .75em 1em; position: fixed; right: auto; text-shadow: 1px 1px #000; top: auto; white-space: pre; z-index: 2147483647;}
@vibby
vibby / dabblet.css
Created February 18, 2016 18:30
Untitled
article {
width:16%;
}
.pgrd-content {
border: 4px solid #BF6B04;
position: relative;
box-shadow: 1px 1px 8px #888;
}
.pgrd-item{
position: relative;
<?php
function f($a,$k){
if(!is_array($a) || !array_key_exists($k, $a)) return false;
$s=$a[$k];
$b=$a;
$b[$k]=!$s;
$t=$a[$k]===!$s;
$a[$k]=$s;
return $t;