Skip to content

Instantly share code, notes, and snippets.

View JofArnold's full-sized avatar

Jof JofArnold

View GitHub Profile
@JofArnold
JofArnold / bem-v-css-modules.scss
Last active December 31, 2016 11:05
How BEM encourages inflation of code whereas CSS modules compares reduction of code
/*
You have a component called MyComponent.jsx and a decidated "locally scoped"
scss file called MyComponent.scss.
For one of the HTML nodes you wish to add a clearfix using something like:
*/
...:after {
clear: both;
content: ".";
@JofArnold
JofArnold / grunt-contrib-concat-json
Created July 26, 2013 17:13
Snippet of Gruntfile.coffee code to wrap a number of json files and attach them to the namespace. Requires grunt-contrib-concat. More flexible than using some of the grunt json packages
concat:
json:
src: ['source/files/here.json']
dest: 'output/files/here.js'
options:
banner: "(function(namespace){\n'use strict'\nnamespace.json={};\n"
footer: "\n})(YOURNAMESPACEHERE)"
process: (src,filepath) ->
arr = filepath.split '/'
filename = arr[arr.length-1]