Skip to content

Instantly share code, notes, and snippets.

View mlaville's full-sized avatar

marc laville mlaville

View GitHub Profile
@mlaville
mlaville / index.php
Created February 23, 2021 22:29 — forked from oriolrivera/index.php
Simple Chat Using WebSocket and PHP Socket
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8' />
<style type="text/css">
<!--
.chat_wrapper {
width: 500px;
margin-right: auto;
margin-left: auto;
<?php
/**
* Extrait les langages disponibles dans firefox à partir de https://support.mozilla.org/fr/locales
*/
preg_match_all('/lang=([a-z]{2,3}.*)">(.*?)<\/a>/', file_get_contents('https://support.mozilla.org/fr/locales'), $matches);
$retour = json_encode( array_combine($matches[1], $matches[2]) );
if( isset( $_GET['callback'] ) ) {
$retour = $_GET['callback'] . "( $retour )"; // jsonP
}
@mlaville
mlaville / purge mysql
Created August 1, 2015 16:08
MySql - Purge des logs binaires
PURGE BINARY LOGS BEFORE '2015-07-01'
@mlaville
mlaville / index.html
Last active August 29, 2015 14:25 — forked from benjchristensen/index.html
Line Graph with Dual-scaled Axes using SVG and d3.js
<html>
<head>
<title>Line Graph with Dual-scaled Axes using SVG and d3.js</title>
<script src="http://mbostock.github.com/d3/d3.v2.js"></script>
<style>
/* tell the SVG path to be a thin blue line without any area fill */
path {
stroke-width: 1;
fill: none;
}