Skip to content

Instantly share code, notes, and snippets.

View galaakk's full-sized avatar

Eric Dejonckheere galaakk

View GitHub Profile
@galaakk
galaakk / gist:5280937
Last active December 15, 2015 15:19
OCTOPRESS: Inverser navigation dans pages
{% if paginator.next_page %}
<a href="{{paginator.next_page}}" class="prev">Plus vieux</a>
{% endif %}
{% if paginator.previous_page %}
<a href="{{paginator.previous_page}}" class="next">Plus récent</a>
{% endif %}
@galaakk
galaakk / _gaq.jade
Created March 12, 2013 14:10
JS/JADE: Google analytics
script
var _gaq=[['_setAccount','UA-XXXXXXXX-X'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
@galaakk
galaakk / _active.jade
Created March 12, 2013 14:10
JS/JADE: Add active class for current URL
script
var url = window.location;$('ul.right a').filter(function() {return this.href == url;}).addClass('active');
@galaakk
galaakk / _favicons.jade
Created March 12, 2013 14:04
JADE: favicons
link(rel="shortcut icon", type="image/x-icon", href="img/favicon.ico")
link(rel="apple-touch-icon", sizes="114x114", href="img/touch-icon-114x114.png")
link(rel="apple-touch-icon", sizes="72x72", href="img/touch-icon-72x72.png")
link(rel="apple-touch-icon", href="img/touch-icon-iphone.png")
@galaakk
galaakk / favicons.kit
Created March 12, 2013 13:50
HTML: favicons
<link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico">
<link rel="apple-touch-icon" sizes="114x114" href="img/touch-icon-114x114.png" />
<link rel="apple-touch-icon" sizes="72x72" href="img/touch-icon-72x72.png" />
<link rel="apple-touch-icon" href="/touch-icon-iphone.png" />
@galaakk
galaakk / gist:5076263
Created March 3, 2013 14:12
JS: Add active class for current URL (works with all URIs)
var url = window.location;
$('nav a').filter(function() {
return this.href == url;
}).addClass('active');
@galaakk
galaakk / gist:4137065
Last active October 13, 2015 04:08
JS: Simple tabs navigation
$(document).ready(function() {
$('nav li a').on('click',function(e) {
$('nav li a').removeClass('active');
var that = $(this);
var content = $('#content');
var toLoad = that.attr('href')+' #content';
that.toggleClass('active');
content.fadeOut('fast',loadContent);
function loadContent(){
content.load(toLoad,'',showNew());
@galaakk
galaakk / gist:3845369
Created October 6, 2012 16:24
SCSS : Emboss mixin
/*Thanks to Chris Coyier*/
@mixin box-emboss($outerOpacity, $innerOpacity) {
box-shadow:
rgba(white, $outerOpacity) 0 1px 0,
rgba(black, $innerOpacity) 0 1px 0 inset;
}
.class{
@include box-emboss(0.3, 0.6);
@galaakk
galaakk / gist:3822347
Created October 2, 2012 18:49
JavaScript : function (reminder)
(function(){
var thing = document.method(parameter);
...
}());
@galaakk
galaakk / _media-queries.scss
Created September 22, 2012 23:49 — 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