Skip to content

Instantly share code, notes, and snippets.

View zouloux's full-sized avatar
🌴
On vacation

Alexis Bouhet zouloux

🌴
On vacation
View GitHub Profile
@zouloux
zouloux / cache_request.php
Created March 24, 2016 10:03
Mise en cache de fichiers avec PHP
<?php
/**
* @version 2.1
* @author Alexis BOUHET
* Email: alexis@lahautesociete.com
* Tribute to JayJay 97
*
* 19 Mai 2010 : MAJ pour cache universel le 20/04/2011
* 22 Mai 2010 : Ajout des méthodes d'enregistrement et de l'option zip dans les contextes.
* Ajout de la méthode statique flush
@zouloux
zouloux / static-noise-three-shader.js
Created March 18, 2016 15:01
A Three.js shader showing digital static noise
(function (THREE)
{
/**
* @author Felix Turner / www.airtight.cc / @felixturner
*
* Static effect. Additively blended digital noise.
*
* amount - amount of noise to add (0 - 1)
* size - size of noise grains (pixels)
*
@zouloux
zouloux / screenshot.js
Created December 7, 2015 16:48
Screenshot case studies on www.lahautesociete.com
// Fixer la hauteur du header
$('.EtudesDeCas_topContainer').css({
height: 500
});
$('.EtudesDeCas_bottomContainer').css({
top: 500
});
// Supprimer les éléments en trop
$('s-menu-button').remove();
@zouloux
zouloux / angleBetweenPoints
Last active August 29, 2015 14:19
Compute angle between 3 points
protected static function angleBetweenPoints (p0:Point, p1:Point, p2:Point):Number
{
var a:Number = Math.pow(p1.x - p0.x, 2) + Math.pow(p1.y - p0.y, 2);
var b:Number = Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2);
var c:Number = Math.pow(p2.x - p0.x, 2) + Math.pow(p2.y - p0.y, 2);
return Math.acos((a + b - c) / Math.sqrt(4 * a * b));
}
@zouloux
zouloux / gist:4d054b0661d2212aee2a
Created March 25, 2015 15:54
How to send correctly data from Socket with Adobe Air
/**
* Donnée sur les socket
*/
protected function socketDataHandler (event:ProgressEvent):void
{
// Cibler le socket
var socket:Socket = (event.target as Socket);
// Here we get our file on ByteArray
@zouloux
zouloux / gist:9599393
Created March 17, 2014 13:43
RadioComponent Solid
<script>
// Un gestionnaire de composants radio
var RadioComponent = function (pDOMGroupSelector, pSelectedHandler)
{
// L'élément DOM associé
var $element;
// La nouvelle DOM
var _newDOM = '<div class="radioComponent">';
_newDOM += ' <span class="radioBack"></span>';
@zouloux
zouloux / SolidConvention
Created March 5, 2014 15:40
SolidConvention to create JS classes like
// Déclaration d'une classe
var MyClass = function (pParam1, pParam2)
{
// Scope fake publique
var that;
// Propriété privée
var _privateVar = 5;
// Méthode privée