Skip to content

Instantly share code, notes, and snippets.

View alcalyn's full-sized avatar

Julien Maulny alcalyn

View GitHub Profile
@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
@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 / 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 / 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 / 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 / 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 / svn.bat
Created February 23, 2015 10:49
Create an alias for svn. (First rename svn.exe to svn-core.exe)
@echo off
if "%1"=="nympho" (
svn-core.exe info
goto :end
)
svn-core.exe %*
:end
@alcalyn
alcalyn / UTF8.js
Last active August 29, 2015 14:16
Utility class about UTF8 string proccessing : get utf8 string length, convert utf8 string to byte array, convert bytes array to utf8 string
/**
* Utility class about UTF8 string proccessing
*
* @type UTF8
*/
var UTF8 =
{
/**
* Returns length in bytes of an utf8 string
*
@alcalyn
alcalyn / data.csv
Last active September 7, 2015 13:15 — forked from gencay/data.csv
State Under 5 Years 5 to 13 Years 14 to 17 Years 18 to 24 Years 25 to 44 Years 45 to 64 Years 65 Years and Over
AL 310504 552339 259034 450818 1231572 1215966 641667
AK 52083 85640 42153 74257 198724 183159 50277
AZ 515910 828669 362642 601943 1804762 1523681 862573
AR 202070 343207 157204 264160 754420 727124 407205
CA 2704659 4499890 2159981 3853788 10604510 8819342 4114496
CO 358280 587154 261701 466194 1464939 1290094 511094
CT 211637 403658 196918 325110 916955 968967 478007