Skip to content

Instantly share code, notes, and snippets.

View davidhund's full-sized avatar

David Hund davidhund

View GitHub Profile
@davidhund
davidhund / svg-sprite-config.js
Created September 16, 2015 09:49
svg-sprite meta-data injection issue
// svg-sprite config
var spriteConfig = {
dest: 'static/svg/min/',
log: 'verbose',
mode: {
symbol: {
dest: './',
prefix: 'svg-%s',
sprite: 'spritemap.svg',
shape: {
@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
@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 / log-gist-comments.js
Last active January 7, 2020 00:15
Log Gist Comments
/**
* Log comments on a particular gist. Verrrry simple/naive/stupid.
* @param {Global} win Window
*/
(function logGistComments(win){
'use strict';
var gid = win.prompt('Gist ID [\'200c7ca83f2dfcd92a09\']', '200c7ca83f2dfcd92a09');
if (gid) {
var url = 'https://api.github.com/gists/{id}/comments'.replace('{id}',gid),
req = new XMLHttpRequest(),
@davidhund
davidhund / pragmatic-touch-icons.md
Last active September 4, 2020 15:42
Pragmatic Touch Icons

NOTE I'm trying to find the most optimal fav/touch icon setup for my use-cases. Nothing new here. Read Mathias Bynens' articles on re-shortcut-icon and touch icons, a FAQ or a Cheat Sheet for all the details.

I'd like to hear how you approach this: @valuedstandards or comment on this gist.

The issue

You have to include a boatload of link elements pointing to many different images to provide (mobile) devices with a 'favicon' or 'touch icon':

![Touch Icon Links](https://o.twimg.com/2/proxy.jpg?t=HBj6AWh0dHBzOi8vcGhvdG9zLTYuZHJvcGJveC5jb20vdC8yL0FBRGFGY1VRN1dfSExnT3cwR1VhUmtaUWRFcWhxSDVGRjNMdXFfbHRJWG1GNFEvMTIvMjI3OTE2L3BuZy8xMDI0eDc2OC8yL18vMC80L1NjcmVlbnNob3QlMjAyMDE1LTA0LTE0JTIwMTYuNTYuMjYucG5nL0NNejBEU0FCSUFJZ0F5Z0JLQUkvNGR1eDZnMzZmYnlzYWI3

@davidhund
davidhund / hsl-codepen.md
Created February 24, 2015 13:17
Simple HSL() example
@davidhund
davidhund / simplest-carousel.md
Created February 24, 2015 11:05
Simplest Carousel Requirements
@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 / 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 / feature-detect flexbox.js
Last active October 17, 2019 16:02
The simplest feature-detect for flexbox?
/*
* Trying to feature-detect (very naive)
* CSS Flexbox support.
* - Only most modern syntax
*
* Is this nonsense?
*/
(function NaiveFlexBoxSupport(d){
var f = "flex", e = d.createElement('b');