Skip to content

Instantly share code, notes, and snippets.

View LespiletteMaxime's full-sized avatar

LESPILETTE Maxime LespiletteMaxime

View GitHub Profile
@LespiletteMaxime
LespiletteMaxime / Browser Detection Apply Classes to HTML Element CSS-Tricks.js
Created November 29, 2012 10:16 — forked from arun057/Browser Detection + Apply Classes to HTML Element CSS-Tricks.js
Javascript : Browser Detection + Apply Classes to HTML Element | CSS-Tricks
// jQBrowser v0.2: http://davecardwell.co.uk/javascript/jquery/plugins/jquery-browserdetect/
//weird characters should be included.
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(c/a))+String.fromCharCode(c%a+161)};while(c--){if(k[c]){p=p.replace(new RegExp(e(c),'g'),k[c])}}return p}('Ö ¡(){® Ø={\'¥\':¡(){¢ £.¥},\'©\':{\'±\':¡(){¢ £.©.±},\'¯\':¡(){¢ £.©.¯}},\'¬\':¡(){¢ £.¬},\'¶\':¡(){¢ £.¶},\'º\':¡(){¢ £.º},\'Á\':¡(){¢ £.Á},\'À\':¡(){¢ £.À},\'½\':¡(){¢ £.½},\'¾\':¡(){¢ £.¾},\'¼\':¡(){¢ £.¼},\'·\':¡(){¢ £.·},\'Â\':¡(){¢ £.Â},\'³\':¡(){¢ £.³},\'Ä\':¡(){¢ £.Ä},\'Ã\':¡(){¢ £.Ã},\'Å\':¡(){¢ £.Å},\'¸\':¡(){¢ £.¸}};$.¥=Ø;® £={\'¥\':\'¿\',\'©\':{\'±\':²,\'¯\':\'¿\'},\'¬\':\'¿\',\'¶\':§,\'º\':§,\'Á\':§,\'À\':§,\'½\':§,\'¾\':§,\'¼\':§,\'·\':§,\'Â\':§,\'³\':§,\'Ä\':§,\'Ã\':§,\'Å\':§,\'¸\':§};Î(® i=0,«=».ì,°=».í,¦=[{\'¤\':\'Ý\',\'¥\':¡(){¢/Ù/.¨(°)}},{\'¤\':\'Ú\',\'¥\':¡(){¢ Û.³!=²}},{\'¤\':\'È\',\'¥\':¡(){¢/È/.¨(°)}},{\'¤\':\'Ü\',\'¥\':¡(){¢/Þ/.¨(°)}},{\'ª\':\'¶\',\'¤\':\'ß Ñ\',\'
@LespiletteMaxime
LespiletteMaxime / .bashrc
Created December 4, 2012 14:20
[BASH] bashrc
## Mon bashrc ##
# Color the hostname
#if [ $HOSTNAME = 'maxime' ]; then
# export HOST_COLOR="\[\033[1;36m\]"
#fi
#if [ $HOSTNAME = 'marvin' ]; then
# export HOST_COLOR="\[\033[1;34m\]"
#fi
#if [ $HOSTNAME = 'leonidas' ]; then
@LespiletteMaxime
LespiletteMaxime / [HTML] Meta Refresh
Created March 29, 2013 11:44
[HTML] Meta Refresh
<meta http-equiv="refresh" content="5;url=http://example.com/" />
@LespiletteMaxime
LespiletteMaxime / [HTML] Meta Tag For Forcing IE 8 to Behave Like IE 7
Created March 29, 2013 11:45
[HTML] Meta Tag For Forcing IE 8 to Behave Like IE 7
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
@LespiletteMaxime
LespiletteMaxime / [CSS] Flip Image
Created March 29, 2013 13:25
[CSS] Flip Image
img {
-moz-transform: scaleX(-1);
-o-transform: scaleX(-1);
-webkit-transform: scaleX(-1);
transform: scaleX(-1);
filter: FlipH;
-ms-filter: "FlipH";
}
@LespiletteMaxime
LespiletteMaxime / [JQUERY] img resize
Created June 19, 2013 09:07
[Jquery] Img resize
$(window).bind("load", function() {
// IMAGE RESIZE
$('#product_cat_list img').each(function() {
var maxWidth = 120;
var maxHeight = 120;
var ratio = 0;
var width = $(this).width();
var height = $(this).height();
if(width > maxWidth){
@LespiletteMaxime
LespiletteMaxime / [Jquery] Load content on scroll automatically
Created June 19, 2013 09:08
[Jquery] Load content on scroll automatically
var loading = false;
$(window).scroll(function(){
if((($(window).scrollTop()+$(window).height())+250)>=$(document).height()){
if(loading == false){
loading = true;
$('#loadingbar').css("display","block");
$.get("load.php?start="+$('#loaded_max').val(), function(loaded){
$('body').append(loaded);
$('#loaded_max').val(parseInt($('#loaded_max').val())+50);
$('#loadingbar').css("display","none");
/* Flatten das boostrap */
.well, .navbar-inner, .popover, .btn, .tooltip, input, select, textarea, pre, .progress, .modal, .add-on, .alert, .table-bordered, .nav>.active>a, .dropdown-menu, .tooltip-inner, .badge, .label, .img-polaroid {
-moz-box-shadow: none !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
-webkit-border-radius: 0px !important;
-moz-border-radius: 0px !important;
border-radius: 0px !important;
border-collapse: collapse !important;
background-image: none !important;
@LespiletteMaxime
LespiletteMaxime / xCurl
Created July 23, 2013 07:33
Perfect cURL Function
function xcurl($url,$ref=null,$post=array(),$ua="Mozilla/5.0 (X11; Linux x86_64; rv:2.2a1pre) Gecko/20110324 Firefox/4.2a1pre",$print=false) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_AUTOREFERER, true);
if(!empty($ref)) {
curl_setopt($ch, CURLOPT_REFERER, $ref);
}
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
@LespiletteMaxime
LespiletteMaxime / base641x1gif.html
Created October 7, 2013 10:58
Base64 Encode of a 1*1px “spacer” GIF
<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7">