Skip to content

Instantly share code, notes, and snippets.

View davidhund's full-sized avatar

David Hund davidhund

View GitHub Profile

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post

@davidhund
davidhund / browsersync-autoprefixer-sync
Last active August 29, 2015 13:57
grunt-browserSync runs before grunt-autoprefixer is done…
I have this Grunt issue where browserSync injects a changes stylesheet before Autoprefixer is done with it. Basically:
1. `Watch` picks up on a changes `style.scss` and runs the `sass:dist` task
2. `sass:dist` outputs `style.scss` -> `style.min.css`
3. next: the `autoprefixer` task processes `style.min.css`
4. **but** in the mean time `browserSync` picks up on the changes `style.min.css` and injects it
5. only now `autoprefixer` finishes with `style.min.css`…
This means my injected `style.min.css` remains out-of-date (no prefixes)...
@davidhund
davidhund / Gruntfile.js
Created April 2, 2014 16:26
Grunt: browserSync kicks in before Autoprefixer finishes?
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// Watch
watch: {
options: {
cwd: 'httpdocs/'
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// Watch
watch: {
options: {
cwd: 'httpdocs/'
@davidhund
davidhund / script-loading-pattern.js
Created January 20, 2015 09:43
Script Loading Pattern
/*
* Taken straight from: http://www.lognormal.com/blog/2012/12/12/the-script-loader-pattern/
*/
(function(url){
// Section 1
var dom,doc,where,iframe = document.createElement('iframe');
iframe.src = "javascript:false";
iframe.title = ""; iframe.role="presentation"; // a11y
(iframe.frameElement || iframe).style.cssText = "width: 0; height: 0; border: 0";
@davidhund
davidhund / browserify-global-module.js
Created February 11, 2015 12:26
Exposing a Global Browserify module
/**
* NOTE: I am new at this and probably miss something obvious :-)
*
* What I'd like to do is the following:
* - Using the Revealing Module Pattern..
* - .. combined with Browserified modules..
* - .. to expose (not export) `myModule` globally in main.js (-> bundle.js)..
* - .. and to use it in the browser e.g: myModule.init()
*
* How do I (best) end up with a global `myModule`??
@davidhund
davidhund / simplest-carousel.md
Created February 24, 2015 11:05
Simplest Carousel Requirements
@davidhund
davidhund / hsl-codepen.md
Created February 24, 2015 13:17
Simple HSL() example
@davidhund
davidhund / Living-Styleguide-Centered-Front-end-Development.md
Created May 7, 2015 10:08
(Living) Styleguide Centered Front-end Development

(Living) Styleguide Centered Front-end Development

Based on / Using:

  • BEM (OOCSS needed because 'components')
  • SCSS
  • NodeJS(?) ([or generate] static)

Gobal flow

@davidhund
davidhund / postcss-scss-issues.txt
Created September 7, 2015 12:57
Issues with running postcss through the CLI and using postcss-scss
I use postcss-cli through `npm run` script.
Using an options.json
When trying to add postcss-scss I get the following error:
```
/node_modules/postcss-cli/index.js:73
plugin = plugin.postcss || plugin();
^
TypeError: object is not a function