Skip to content

Instantly share code, notes, and snippets.

View herrkessler's full-sized avatar
:octocat:

Sebastian Kessler herrkessler

:octocat:
View GitHub Profile
@herrkessler
herrkessler / Gulpfile.js
Last active April 11, 2017 07:32
Gulp static compiler
'use strict';
var postcss = require('gulp-postcss');
var gulp = require('gulp');
var autoprefixer = require('autoprefixer');
var cssnano = require('cssnano');
var sass = require('gulp-sass');
var include = require('gulp-include');
var concat = require('gulp-concat');
var browserSync = require('browser-sync').create();
mixin picture(path, name, type)
picture
each val in type
source(srcset=path + "/" + name + "." + val type="image/" + val)
img(src=path + "/" + name + ".jpg" alt=name)
+picture('path/to', 'image', ['jpg','webp'])
// Compiles to
//------------------------
@herrkessler
herrkessler / dom-helper.js
Created April 5, 2017 06:49 — forked from SitePointEditors/dom-helper.js
Mini jQuery, sort of.
/**
* A collection of helper prototype for everyday DOM traversal, manipulation,
* and event binding. Sort of a minimalist jQuery, mainly for demonstration
* purposes. MIT @ m3g4p0p
*/
window.$ = (function (undefined) {
/**
* Duration constants
* @type {Object}
@mixin for-phone-only {
@media (max-width: 599px) { @content; }
}
@mixin for-tablet-portrait-up {
@media (min-width: 600px) { @content; }
}
@mixin for-tablet-landscape-up {
@media (min-width: 900px) { @content; }
}
@mixin for-desktop-up {
mixin img
-
attributes.src = attributes.src || ''
attributes.alt = attributes.alt || ""
if(!attributes.adaptive && !attributes.webp && !attributes.retina)
img(src = attributes.src, class = attributes.class, alt = attributes.alt)
else
-
var chunks = attributes.src.split('.')
@herrkessler
herrkessler / ChromeExtensionGulp.js
Created August 24, 2016 11:37 — forked from TravelingTechGuy/ChromeExtensionGulp.js
Gulp file for building a Chrome Extension
'use strict';
//npm install gulp gulp-minify-css gulp-uglify gulp-clean gulp-cleanhtml gulp-jshint gulp-strip-debug gulp-zip --save-dev
var gulp = require('gulp'),
clean = require('gulp-clean'),
cleanhtml = require('gulp-cleanhtml'),
minifycss = require('gulp-minify-css'),
jshint = require('gulp-jshint'),
stripdebug = require('gulp-strip-debug'),
@herrkessler
herrkessler / fb-canvas.js
Created July 29, 2016 07:52
FB.Canvas re-shrink
FB.Canvas.setSize({height:600});
setTimeout("FB.Canvas.setAutoGrow()",500);
@herrkessler
herrkessler / delete.txt
Last active June 29, 2016 09:59
deleting all node_modules and bower_components
find . -name "node_modules" -exec rm -rf '{}' +
find . -name "bower_components" -exec rm -rf '{}' +
from https://coderwall.com/p/guqrca/remove-all-node_module-folders-recursively
@herrkessler
herrkessler / MailChimp-Footer-Code.html
Created June 15, 2016 14:01 — forked from oneblackcrayon/MailChimp-Footer-Code.html
MailChimp Required Footer Code. This should help you remove the grey footer that gets put at the bottom of your emails.
@herrkessler
herrkessler / menu-icon.jade
Last active April 25, 2016 13:47
hamburger icon
a(href="#").js-mobile-menu#menu-icon
span
span
span