Skip to content

Instantly share code, notes, and snippets.

View fstiehle's full-sized avatar
🏠
Working from home

Fabian Stiehle fstiehle

🏠
Working from home
View GitHub Profile
@fstiehle
fstiehle / gulpfile.js
Created December 21, 2018 04:29
Gulp + WordPress + SASS + Autoprefix + LiveReload
var gulp = require('gulp'),
sass = require('gulp-sass'),
autoprefixer = require('gulp-autoprefixer'),
rename = require('gulp-rename'),
livereload = require('gulp-livereload');
gulp.task('sass', function () {
return gulp.src('./sass/style.scss')
.pipe(sass.sync().on('error', sass.logError))
.pipe(autoprefixer('last 2 versions'))
@fstiehle
fstiehle / responsiveImages.js
Last active September 21, 2017 16:47
Photoshop script to export image to web in different sizes (handy for responsive images)
/**
* Exports current image to web with
* sizes as defined in sizes.
*/
var fileName = app.activeDocument.name.replace(/\.[^\.]+$/, '');
var saveFile = "~/Projects/E5/Edit/final" // Edit this
var suffix = 0;
var jpegQuality = 80;
/**
@fstiehle
fstiehle / Squarespace_head.html
Last active September 6, 2017 14:33
Translates Squarespace form; Supports AJAX loading through MutationObserver; No JQuery
<script>
(function(window) {
var input_button = "input.button";
var observer;
window.addEventListener("load", function() {
watch(react);
react();
});
@fstiehle
fstiehle / reset.scss
Created August 29, 2017 19:01 — forked from HamptonMakes/reset.scss
Reset SCSS
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
@fstiehle
fstiehle / CoreDataConvenience.swift
Created June 26, 2017 08:27
Hide CoreData initialization behind a convenience constructor
class Example: NSManagedObject {
convenience init() {
let managedObjectContext: NSManagedObjectContext = DataModel.sharedInstance.managedObjectContext
let entity = NSEntityDescription.entity(forEntityName: "Example", in: managedObjectContext)!
self.init(entity: entity, insertInto: managedObjectContext)
}
}
@fstiehle
fstiehle / char_driver.c
Last active June 9, 2017 13:05
Linux char driver Boilerplate
#include <linux/module.h>
#include <linux/fs.h>
#include <linux/cdev.h>
#include <linux/device.h>
#include <linux/slab.h>
MODULE_AUTHOR("Fabian Stiehle");
MODULE_DESCRIPTION("");
MODULE_LICENSE("GPL");
img {
background-color: #ccc;
}
<script src="defer.js" defer></script>
<script src="async.js" async></script>
body {
font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}