Skip to content

Instantly share code, notes, and snippets.

View lvl-svasseur's full-sized avatar

Stéphane Vasseur lvl-svasseur

View GitHub Profile
@lvl-svasseur
lvl-svasseur / forceRepaint.js
Last active December 28, 2015 20:09
Force Repaint
/**
* source : http://stackoverflow.com/questions/3485365/how-can-i-force-webkit-to-redraw-repaint-to-propagate-style-changes
*/
sel.style.display='none';
sel.offsetHeight; // no need to store this anywhere, the reference is enough
sel.style.display='block';
@lvl-svasseur
lvl-svasseur / postRepeatDirective.ng.js
Last active December 28, 2015 22:09
Angular.js - Time logging directive
// Post repeat directive for logging the rendering time
angular.module('siApp.services').directive('postRepeatDirective',
['$timeout', '$log', 'TimeTracker',
function($timeout, $log, TimeTracker) {
return function(scope, element, attrs) {
if (scope.$last){
$timeout(function(){
var timeFinishedLoadingList = TimeTracker.reviewListLoaded();
var ref = new Date(timeFinishedLoadingList);
var end = new Date();
@lvl-svasseur
lvl-svasseur / retinafy.css
Created December 3, 2013 17:12
media query to detect retina screen
@media (min--moz-device-pixel-ratio: 1.5),
(-o-min-device-pixel-ratio: 3/2),
(-webkit-min-device-pixel-ratio: 1.5),
(min-device-pixel-ratio: 1.5),
(min-resolution: 1.5dppx) {
/* your retina rules here */
}
@lvl-svasseur
lvl-svasseur / .gitconfig
Last active January 1, 2020 17:29 — forked from coderxin/git-merge-tool
git mergetool config (by command line or .gitconfig)
[merge]
tool = intellij
# tool = Kaleidoscope
[diff]
tool = intellij
# tool = Kaleidoscope
# intellij mergetool config
[mergetool "intellij"]
cmd = /Applications/IntelliJ\\ IDEA\ 13\\ CE.app/Contents/MacOS/idea merge $(cd $(dirname "$LOCAL") && pwd)/$(basename "$LOCAL") $(cd $(dirname "$REMOTE") && pwd)/$(basename "$REMOTE") $(cd $(dirname "$BASE") && pwd)/$(basename "$BASE") $(cd $(dirname "$MERGED") && pwd)/$(basename "$MERGED")
@lvl-svasseur
lvl-svasseur / gitPushOverTagName
Last active December 30, 2015 22:49
Git push over branch/tag name ambiguity
git push origin refs/heads/1.1.21:refs/heads/1.1.21
@lvl-svasseur
lvl-svasseur / nodeJsUpdate.sh
Created December 12, 2013 15:43
Update nodeJs
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
# https://gist.github.com/driesvints/5960662
# Ensures all line endings are committed as LF, but will checkout with native line endings
* text=auto
# -- Override Section, just in-case Git tries to be sneaky
# Ensure that these files are recognized as text
*.asp text
*.aspx text
*.asx text
{
// Details: https://github.com/victorporof/Sublime-JSHint#using-your-own-jshintrc-options
// Example: https://github.com/jshint/jshint/blob/master/examples/.jshintrc
// Documentation: http://www.jshint.com/docs/
// Enforcing
"indent": 4,
"quotmark": false,
"camelcase": true,
"newcap": true,
# generated
app/app.css
app/ie9.css
app/app.js
app/scripts/config.js
app/images/ui-*.png
test/app.js
#bower
*vendor*
@lvl-svasseur
lvl-svasseur / global-index-page-config.json
Last active August 29, 2015 14:01
config feed global index page
{
"background-image": {
"2560x1400": {
"src": "http:\/\/dev.sync.amctv.com\/wp-content\/uploads\/2013\/09\/new-background.jpg",
"width": "2560",
"height": "1400"
}
},
"storysync-logo-image": {
// retina size