Skip to content

Instantly share code, notes, and snippets.

View Victa's full-sized avatar
🏠
Working from home

Victor Coulon Victa

🏠
Working from home
View GitHub Profile
@Victa
Victa / LICENSE.txt
Created November 21, 2012 20:27 — forked from atk/LICENSE.txt
polyfill an ES5-compatible Array.prototype.indexOf
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Alex Kloss <alexthkloss@web.de>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@Victa
Victa / index.html
Created November 20, 2012 13:55
140byt.es loading spinner
<body>
<div id="spinner"></div>
</body>​
@Victa
Victa / gist:3979257
Created October 30, 2012 09:35
Add Javascript String.trim() Support for Older Browsers
String.prototype.trim = typeof (String.prototype.trim) != "undefined" ?
String.prototype.trim :
function() { return this.replace(/^\s\s*/, '').replace(/\s\s*$/, ''); };
@Victa
Victa / gist:3937605
Created October 23, 2012 08:19
is_email JavaScript
function is_email(id){return (/^([\w!.%+\-\*])+@([\w\-])+(?:\.[\w\-]+)+$/).test(id);}
@Victa
Victa / async.js
Created September 5, 2012 08:34
Asynchronous Script Loading
function asyncLoad(scriptURL,callback)
{
if(!scriptURL){return;}
var firstScriptTag=document.getElementsByTagName('script')[0];
var js=document.createElement('script');
js.type='text/javascript';
js.src=scriptURL;
js.async=true;
if(callback && typeof(callback)===typeof(Function))
@Victa
Victa / Years between two dates
Created August 30, 2012 07:30 — forked from banksy89/Years between two dates
Get the number of years between two dates using PHP DateTime class
// My Birthday :)
$date_1 = new DateTime( '1989-06-15' );
// Todays date
$date_2 = new DateTime( date( 'Y-m-d' ) );
$difference = $date_2->diff( $date_1 );
// Echo the as string to display in browser for testing
echo (string)$difference->y;
@Victa
Victa / retina.css
Created August 24, 2012 14:43 — forked from maximevalette/retina.css
Capturer les écrans Retina avec une media query
@media
only screen and (-webkit-min-device-pixel-ratio: 1.3),
only screen and (min-device-pixel-ratio: 1.3),
only screen and (min-resolution: 120dpi) {
/* Votre code ici pour les écrans Retina */
}
@Victa
Victa / keys.json
Created August 22, 2012 12:04
My Sublime Text 2 config
[
{ "keys": ["ctrl+s"], "command": "toggle_side_bar" },
{ "keys": ["ctrl+i"], "command": "toggle_setting", "args": {"setting": "gutter"} }
]
@Victa
Victa / gist:3313052
Created August 10, 2012 09:46
Sass Button Mixin - Inspired by Bourbon button mixin
/*------------------------------------*\
Auto Button Mixin
\*------------------------------------*/
@mixin button( $base-color: #f9f9f9,
$radius: 4px,
$bold: true,
$drop-shadow: true,
$padding: '.5em 1.5em'){
@Victa
Victa / dabblet.css
Created July 13, 2012 09:57
Checkbox Custom Style
/* Checkbox Custom Style
* ========================
* Courtesy of ??? (I don't remember who showed me this trick)
* @_victa
*/
/* Old Skool Reset */
*{margin:0;padding:0}
html,body{height:100%}
body{