Skip to content

Instantly share code, notes, and snippets.

View nielk's full-sized avatar
🦊

Alexandre Oger nielk

🦊
View GitHub Profile
@nielk
nielk / gist:7194486
Created October 28, 2013 10:21
git log in one line
git log --pretty=oneline
# other options:
git log --pretty=oneline --max-count=2
git log --pretty=oneline --since='5 minutes ago'
git log --pretty=oneline --until='5 minutes ago'
@nielk
nielk / liens-évitement.js
Last active December 30, 2015 05:59
liens d'évitement cross browser (IE8+)
if (!window.addEventListener) {
window.attachEvent("onhashchange", function(event) {
var element = document.getElementById(location.hash.substring(1));
if (element) {
if (!/^(?:a|select|input|button|textarea)$/i.test(element.tagName)) {
element.tabIndex = -1;
}
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
<div>1</div>
<div>2</div>
@nielk
nielk / gist:8538092
Created January 21, 2014 11:03
Git : failed to write object .git/objects error preprod

MISE EN PRE/PROD ERREURS

error: insufficient permission for adding an object to repository database .git/objects

fatal: failed to write object
fatal: unpack-objects failed
/**
* 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');
});
}
@nielk
nielk / carousel.js
Created January 28, 2014 10:25 — forked from barryvdh/carousel.js
@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 / 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 / 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 / IE aliasing white border
Created February 18, 2014 11:35
IE aliasing white border
http://codepen.io/gaetanark/pen/cwxoG