Skip to content

Instantly share code, notes, and snippets.

View nielk's full-sized avatar
🦊

Alexandre Oger nielk

🦊
View GitHub Profile
@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 / 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 / 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 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 / my-module.js
Last active August 29, 2015 14:01
javascript pattern with jquery
var myModule = (function($, window) {
// private property
var myProp = "hello";
// private methods
function myPrivateMethod() {
alert($('*').length);
};
// public methods
return {
init: function() {
@nielk
nielk / index.html
Created June 3, 2014 13:01
menu toggle scroll
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div class="container">
<h1>
Lorem ipsum
</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Neque, suscipit velit nihil deleniti cumque reiciendis ea expedita commodi aut nemo assumenda asperiores harum dolorum ipsum at quidem ad iste fugiat. consectetur adipisicing elit. Neque, suscipit velit nihil deleniti cumque reiciendis ea expedita commodi aut nemo assumenda asperiores harum dolorum ipsum at quidem ad iste fugiat. </p>
@nielk
nielk / EventFactory.js
Created June 11, 2014 13:40
Event scroll touch click
//
// .important touch/click event
// ==========================================================================
/**
* Event factory
*/
var eventFactory = function($elt, callback) {
var flag = true;
var touchStartPos;
@nielk
nielk / js-checklist.md
Last active August 29, 2015 14:02
Javascript checklist

Javascript checklist

Legend:

☐ item

✔ item done

Checklist

☐ use 'use strict';

@nielk
nielk / gist:9262c152867a7dba8337
Created July 16, 2014 18:57
baseline grid css
#baseline.show-grid {
background: -webkit-linear-gradient(top,rgba(50,50,50, 0.2)0,rgba(50,50,50, 0.2)1px,rgba(255, 255, 255, 0)1px,rgba(255, 255, 255, 0)2px);
background: -webkit-gradient(linear,left top,left bottom,color-stop(0px,rgba(50,50,50,.2)),color-stop(1px,rgba(50,50,50,.2)),color-stop(1px,rgba(255,255,255,0)),color-stop(2px,rgba(255,255,255,0)));
background: linear-gradient(to bottom,rgba(50,50,50, 0.2)0,rgba(50,50,50, 0.2)1px,rgba(255, 255, 255, 0)1px,rgba(255, 255, 255, 0)2px);
background-size: 100% 1rem;
}
@nielk
nielk / drush.txt
Created July 28, 2014 07:57
drush cache disable
drush vset cache 0
drush vset preprocess_css 0
drush vset preprocess_js 0