Skip to content

Instantly share code, notes, and snippets.

View ifcanduela's full-sized avatar

Igor Fernández Canduela ifcanduela

  • Utrecht, The Netherlands
View GitHub Profile
@ifcanduela
ifcanduela / .watch
Last active July 26, 2018 06:58
Dead-simple PHP file watcher and task runner.
assets/css/*.less
assets/css/*/*.less
lessc assets/css/app.less app.css
@ifcanduela
ifcanduela / fn.format_number.js
Created February 2, 2017 08:18
A simple function to add thousands separators to a number.
function format_number(number) {
// split integer and decimal parts
var parts = ('' + number).split('.');
var significand = parts[0];
// check if there is a decimal part
var decimal = typeof parts[1] !== 'undefined' ? parts[1] : false;
// reverse the integer part
var reversed = (significand).split('').reverse().join('');
@ifcanduela
ifcanduela / breakpoints.less
Last active April 27, 2017 15:03
Responsive breakpoints using LESS variables
///////////////////////////////////////////////////////////////////////////////
// RESPONSIVE BREAKPOINTS
@xs: 640px;
@xs_plus_one: (@xs + 1px);
@sm: 768px;
@sm_plus_one: (@sm + 1px);
@md: 992px;
@md_plus_one: (@md + 1px);
@lg: 1200px;
@ifcanduela
ifcanduela / less_namespace_import.less
Created July 2, 2014 13:44
How to import a CSS/LESS file from another project into a LESS namespace, prefixing all imported styles.
/* foreign.less */
/* new file, "bridge" between imported styles and stylesheet */
#export {
.styles() {
@import (less) "../../other-project/css/styles.css";
}
}
/* old file */