Skip to content

Instantly share code, notes, and snippets.

@jaseflow
jaseflow / flex.css
Created July 31, 2015 04:34
Flex BEM classes
.flex {
display: flex
}
.flex--centered {
justify-content: center;
}
.flex--aligned {
align-items: center;
@marcoslopes
marcoslopes / Mac::Pomodoro
Last active August 29, 2015 14:24
Mac::Pomodoro
#!/bin/sh
#
####################################
# Pomodoro
####################################
showHelp () {
echo "-------------------------------";
echo "Pomodoro Command Line Interface";
echo "-------------------------------";
@codler
codler / flex.less
Last active October 7, 2023 07:01
Prefix flex for IE10 and Safari / iOS in LESS
/*! Prefix flex for IE10 and Safari / iOS in LESS
* https://gist.github.com/codler/2148ba4ff096a19f08ea
* Copyright (c) 2014 Han Lin Yap http://yap.nu; MIT license */
.display(@value) when (@value = flex) {
display: -ms-flexbox; // IE10
display: -webkit-flex; // Safari / iOS
}
.display(@value) when (@value = inline-flex) {
@kris-ellery
kris-ellery / JS-error-tracking-with-GA.js
Last active November 18, 2021 19:00
Track JavaScript errors using Universal Analytics from Google.
/**
* Track JS error details in Universal Analytics
*/
function trackJavaScriptError(e) {
var errMsg = e.message;
var errSrc = e.filename + ': ' + e.lineno;
ga('send', 'event', 'JavaScript Error', errMsg, errSrc, { 'nonInteraction': 1 });
}
@chrsr
chrsr / A-Pen-by-Chris-Roberts.markdown
Last active December 22, 2015 06:29
A Pen by Chris Roberts.
@Warry
Warry / Article.md
Created December 11, 2012 00:11
How to make faster scroll effects?

How to make faster scroll effects?

  • Avoid too many reflows (the browser to recalculate everything)
  • Use advanced CSS3 for graphic card rendering
  • Precalculate sizes and positions

Beware of reflows

The reflow appens as many times as there are frames per seconds. It recalculate all positions that change in order to diplay them. Basically, when you scroll you execute a function where you move things between two reflows. But there are functions that triggers reflows such as jQuery offset, scroll... So there are two things to take care about when you dynamically change objects in javascript to avoid too many reflows:

@scottgonzalez
scottgonzalez / 1.8.js
Created May 9, 2011 16:42
quick overview of extending jQuery UI widgets in 1.8 and 1.9
(function( $, prototype ) {
$.extend( prototype.options, {
spinner: "<em>Loading&#8230;</em>"
});
var _create = prototype._create;
prototype._create = function() {
_create.call( this );
var self = this;