Skip to content

Instantly share code, notes, and snippets.

View nielk's full-sized avatar
🦊

Alexandre Oger nielk

🦊
View GitHub Profile
@nielk
nielk / main.js
Created March 18, 2014 08:19
requirejs simple example
require.config({
paths: {
'jQuery': '../vendors/jquery/jquery-1.11.0.min',
'carousel': '../vendors/bootstrap/js/carousel',
'transition': '../vendors/bootstrap/js/transition',
'swipe': '../vendors/jquery-swipe/jquery.touchSwipe.min',
'select' : '../vendors/select-0.5.0/select.min'
},
shim: {
'jQuery': {
@nielk
nielk / alex.zsh
Created February 27, 2014 15:50
alias ssh
alias preprod='sshpass -p 'pwd' ssh user@host -t "cd /var/www/preprod; bash"'
@nielk
nielk / main.js
Created February 27, 2014 10:56
menu accordéon accessible
/* click event & slide */
/* http://alex-d.fr/blog/ordre-des-evenements-javascript-click-touch-focus-et-confreres */
var click = false;
$('#menu li a').click( function() {
click = true;
var openMe = $(this).next();
var mySiblings = $(this).parent().siblings().find('ul');
if (openMe.is(':visible')) {
@nielk
nielk / accessibilité-carousel-bootstrap
Created February 19, 2014 14:46
accessibilité carousel bootstrap : afficher tout les items lorsque javascript est désactivé
@nielk
nielk / IE aliasing white border
Created February 18, 2014 11:35
IE aliasing white border
http://codepen.io/gaetanark/pen/cwxoG
@nielk
nielk / menu.js
Created February 13, 2014 14:03
Menu slide toggle
/**
* Menu
*/
/* Init */
$('.menu nav > li > ul').slideToggle(0);
/* click event & slide */
$('.menu nav > li > a').click(function() {
var that = $(this).parent().children('ul');
@nielk
nielk / debug-responsive.less
Created February 10, 2014 09:11
debug-responsive bootstrap utility
body:before {
content: "000";
position: fixed;
bottom: 0;
background-color: #333;
padding: .5em;
color: #fff;
opacity: .3;
z-index: 100000;
}
@nielk
nielk / X-UA-Compatible.php
Last active August 29, 2015 13:55
Bad value X-UA-Compatible for attribute http-equiv - http://validator.nu/
<?php
if (isset($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false))
header('X-UA-Compatible: IE=edge,chrome=1');
?>
@nielk
nielk / carousel.js
Created January 28, 2014 10:25 — forked from barryvdh/carousel.js
/**
* SVG not supported ? png fallback
*/
if (!document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image", "1.1")) {
$('img[src*="svg"]').attr('src', function() {
return $(this).attr('src').replace('.svg', '.png');
});
}