Skip to content

Instantly share code, notes, and snippets.

View kreo's full-sized avatar
:atom:
System Failture. Try again🁢

Fabio Cencetti kreo

:atom:
System Failture. Try again🁢
View GitHub Profile
@kreo
kreo / index.html
Last active September 17, 2015 07:53 — forked from hdragomir/index.html
IIFE version of SM Font Loading
<script type="text/javascript">
(function (css_href) {
"use strict";
// a simple event handler wrapper
function on(el, ev, callback) {
if (el.addEventListener) {
el.addEventListener(ev, callback, false);
} else if (el.attachEvent) {
el.attachEvent("on" + ev, callback);
@kreo
kreo / sm-annotated.html
Last active September 17, 2015 07:53 — forked from hdragomir/sm-annotated.html
The deferred font loading logic for Smashing Magazine. http://www.smashingmagazine.com/
<script type="text/javascript">
(function () {
"use strict";
// once cached, the css file is stored on the client forever unless
// the URL below is changed. Any change will invalidate the cache
var css_href = './index_files/web-fonts.css';
// a simple event handler wrapper
function on(el, ev, callback) {
if (el.addEventListener) {
el.addEventListener(ev, callback, false);
@kreo
kreo / gist:acff04647bb65f063890
Created October 1, 2015 14:14 — forked from tonymtz/gist:d75101d9bdf764c890ef
Uninstall nodejs from OSX Yosemite
# First:
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*
# To recap, the best way (I've found) to completely uninstall node + npm is to do the following:
#go to /usr/local/lib and delete any node and node_modules
cd /usr/local/lib
sudo rm -rf node*
@kreo
kreo / _color-palette.scss
Created November 13, 2015 04:53 — forked from samuel-holt/_color-palette.scss
Dynamic color palette mixin
// =================================
// Color palette generator
// =================================
// Muck around with colors here:
$primary-color: salmon;
// A global to store the palette(s)
$global-color-palettes: () !global;
@kreo
kreo / caret.scss
Created November 16, 2015 10:04 — forked from zanetaylor/caret.scss
SASS caret mixin
@mixin caret($point, $border-width, $color) {
$opposite: opposite-position($point);
border: $border-width solid transparent;
border-#{$opposite}: $border-width solid $color;
border-#{$point}: 0;
height: 0;
width: 0;
}
@kreo
kreo / SassMeister-input.scss
Created December 1, 2015 11:06 — forked from jlong/SassMeister-input.scss
Navigate a nested maps with map-fetch() in Sass
// ----
// Sass (v3.3.0.rc.2)
// Compass (v1.0.0.alpha.17)
// ----
//
// map-fetch($map, $keys)
//
// An easy way to fetch a deep value in a multi-level map. Works much like
// map-get() except that you pass multiple keys as the second parameter to
@kreo
kreo / bower-multi.bash
Created December 10, 2015 00:15 — forked from M1ke/bower-multi.bash
Bower multiple install directories. For those using `bower` but not grunt who want to take advantage of the multiple cwd values described in https://github.com/bower/bower/issues/212
#!/bin/bash
# Install bower `npm -g install bower`
# Create directory in project root:
# bower/
# Then create subdirectories for each bower setup
# bower/public/bower.json
# bower/compiled/bower.json
# The path installed into will be in the same directory as `bower` with the same name as the subdir
# ./public
@kreo
kreo / README.md
Created January 4, 2016 15:59 — forked from stephenway/README.md
BEMIT Cheatsheet
@kreo
kreo / gulp-resize-and-minify-images.js
Created January 18, 2016 11:36 — forked from ryantbrown/gulp-resize-and-minify-images.js
Gulp - Resize and Optimize / Minify Images
/**
* Make sure Graphicsmagick is installed on your system
* osx: brew install graphicsmagick
* ubuntu: apt-get install graphicsmagick
*
* Install these gulp plugins
* glup, gulp-image-resize, gulp-imagemin and imagemin-pngquant
*
* Group images according to their output dimensions.
* (ex: place all portfolio images into "images/portfolio"
@kreo
kreo / SassMeister-input.scss
Created February 16, 2016 14:52 — forked from davidkpiano/SassMeister-input.scss
Generated by SassMeister.com.
// ----
// Sass (v3.4.11)
// Compass (v1.0.3)
// ----
@function math-pow($number, $exp) {
@if (round($exp) != $exp) {
@return math-exp($exp * math-ln($number));
}