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
/**
* jQuery.preload
*
* Preload images using the promise pattern.
*
* Usage:
*
* $.preload(img_uri, img_uri, ...).done(function(img, img, ...) {
* // Do stuff with the arguments
* });
@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 / 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 / targetblank.js
Created May 27, 2012 08:29 — forked from bastianallgeier/targetblank.js
Do your clients have the incurable target=_blank disease for external links? Add this jQuery snippet to your js code to add targets to all external links.
$(function() {
$('a').not('[href*=clientdomain\\.com]').attr('target', '_blank');
});
@Victa
Victa / _media-queries.scss
Created March 26, 2012 13:09 — forked from anthonyshort/_media-queries.scss
Media Queries in Sass
// Media Queries in Sass 3.2
//
// These mixins make media queries a breeze with Sass.
// The media queries from mobile up until desktop all
// trigger at different points along the way
//
// And important point to remember is that and width
// over the portrait width is considered to be part of the
// landscape width. This allows us to capture widths of devices
// that might not fit the dimensions exactly. This means the break
@Victa
Victa / README
Created December 30, 2011 11:43 — forked from ncr/README
jquery.single_double_click
Code
$("button").single_double_click(function () {
alert("Try double-clicking me!")
}, function () {
alert("Double click detected, I'm hiding")
$(this).hide()
})