Skip to content

Instantly share code, notes, and snippets.

View herrkessler's full-sized avatar
:octocat:

Sebastian Kessler herrkessler

:octocat:
View GitHub Profile
#!/bin/bash -e
## split-image.sh - Split a large image into same-size tiles
## Split a large image into same-size tiles
## and optionally convert to a print-ready PDF document
##
## For example split a huge A1-size banner into 8x A4 tiles
## and create a single PDF ready for print.
// disable :hover on touch devices
// based on https://gist.github.com/4404503
// via https://twitter.com/javan/status/284873379062890496
// + https://twitter.com/pennig/status/285790598642946048
// re http://retrogamecrunch.com/tmp/hover
// NOTE: we should use .no-touch class on CSS
// instead of relying on this JS code
function removeHoverCSSRule() {
if ('createTouch' in document) {
try {
@herrkessler
herrkessler / pmsg.haml
Created June 29, 2015 07:25
Poor Man's Style Guide - slim / haml / jade
%h1#headings Headings
%h1 Heading 1
%h2 Heading 2
%h3 Heading 3
%h4 Heading 4
%h5 Heading 5
%h6 Heading 6
%hr
%h1#headings-with-text Headings with Text
Warden::Manager.serialize_into_session{|user| user.id }
Warden::Manager.serialize_from_session{|id| User.get(id) }
Warden::Manager.before_failure do |env,opts|
# Sinatra is very sensitive to the request method
# since authentication could fail on any type of method, we need
# to set it for the failure app so it is routed to the correct block
env['REQUEST_METHOD'] = "POST"
end
@herrkessler
herrkessler / menu-icon.jade
Last active April 25, 2016 13:47
hamburger icon
a(href="#").js-mobile-menu#menu-icon
span
span
span
@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 / 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 / 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 / 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'),
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('.')