Skip to content

Instantly share code, notes, and snippets.

View alcalyn's full-sized avatar

Julien Maulny alcalyn

View GitHub Profile
@alcalyn
alcalyn / getFileArray.php
Created February 22, 2015 13:22
Get File data array from a multidimensionnal $_FILES post array
/**
* Get a single file data from an array of files.
* Provide null for file keys ('name', 'tmp_name', ...)
* See example below
*
* @param array $files $_FILES
* @param array $path path to file data
* @return array file data
*/
@alcalyn
alcalyn / consoleColorFontSize.js
Last active August 29, 2015 14:10
Console log color and custom font
console.log('%cHello %cyou', 'font-size:20px', 'font-size:28px;color:#800');
@alcalyn
alcalyn / a_guess_random_bot_value.js
Last active August 29, 2015 14:09
Can you create an algorithm that guesses the next random value ?
var RandomBot =
{
/**
* Returns random boolean
*
* @returns {Boolean}
*/
rand: function ()
{
return Math.random() < 0.5;
@alcalyn
alcalyn / twitter.js
Last active May 8, 2016 10:16
Twitter filter
/**
* Filter people you are following but they are not following you.
*
* Go to:
* https://twitter.com/following
*
* and run:
*/
setInterval(function(){jQuery('.FollowStatus').closest('.Grid-cell').remove()},1e3)
@alcalyn
alcalyn / main.js
Last active August 29, 2015 14:09
Simple and decoupled more or less game in Javascript
/**
* Run + or - game.
*
* To play it now, just call: runGame();
*
* @param {Object} interface which you want to use. Default is Prompt
* @param {Number} max number. Secret number will be between 0 and max. Default is 100
* @param {boolean} decimal whether you allow decimal number. Default is false
* @param {Number} secret number. Force the secret number. Default is random.
*/
@alcalyn
alcalyn / sql injections
Last active August 29, 2015 14:08
Ouch!
https://github.com/search?p=3&q=extension:php+mysql_query+$_GET&ref=searchresults&type=Code