Skip to content

Instantly share code, notes, and snippets.

View nielk's full-sized avatar
🦊

Alexandre Oger nielk

🦊
View GitHub Profile
@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
<!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 / 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;
}
@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 / gist:7067612
Last active December 26, 2015 00:58
avoid JSLint errors
(function () {
'use strict';
/*jslint evil: true */
/*jslint browser:true */
var person, anotherPerson; // var statements at begin
/*
My code here
*/
}());
@nielk
nielk / infinite-scroll-jquery-angularjs.html
Last active December 25, 2015 14:39
angularjs ng-repeat infinite scroll with jquery
<div ng-app="app" ng-controller="listCtrl" id="listr" ng-init="count=10">
<div ng-repeat="chose in choses | orderBy:'date':true | limitTo:count" class="choses">
<section class="inner">
<div class="row container-chose">
<div class="col-sm-2 col-md-2 col-lg-2" ng-class-odd="'odd'" ng-class-even="'even'">
<img src="./uploads/{{chose.image}}" class="img-circle chose" />
</div>
<div class="col-sm-5 col-md-5 col-lg-5" ng-class-odd="'even'" ng-class-even="'odd'">
<h2>{{chose.title}} par {{chose.author}}</h2>
<p>{{chose.content}}</p>
@nielk
nielk / main.css
Created October 10, 2013 18:48
css vertical and horizontal centered element
.centered {
width: 100px;
height: 100px;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
margin: auto;
background-color: blue;
@nielk
nielk / index.html
Last active December 24, 2015 14:09
Bootstrap/angularjs Form with validation
<!doctype html>
<html ng-app="myApp">
<head>
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div ng-controller="myCtrl">
@nielk
nielk / gist:6615163
Created September 18, 2013 20:27
an example of regex with variable
var tmp = '.txt'
var ext = new RegExp("\\."+tmp+'$') // recherche extension de fichier
@nielk
nielk / gist:6495997
Created September 9, 2013 14:02
Bootstrap container without margin
body {
padding: 0;
}
.container {
background-color: yellow;
min-width: 100%;
padding: 0;
}