Skip to content

Instantly share code, notes, and snippets.

View allmarkedup's full-sized avatar

Mark Perkins allmarkedup

View GitHub Profile
@allmarkedup
allmarkedup / fractal.js
Created March 5, 2016 21:14
Configuring fractal as part of a bootstrap process in another file
require('./setup.js');
@allmarkedup
allmarkedup / fractal.js
Created March 5, 2016 12:34
Add markdown filter to the Fractal nunjucks engine
var md = require('marked');
fractal.engine('nunjucks', '@frctl/nunjucks-engine', {
filters: {
markdown: function(str){
return md(str);
}
}
});
@allmarkedup
allmarkedup / fractal.js
Last active February 23, 2016 01:39
Custom theme development in Fractal
'use strict';
const fractal = require('@frctl/fractal');
//.... other config items
fractal.set('plugins.web.theme', 'example-theme');
{{ figure.content }} {!-- prints out ok, not markdown converted --}
{!-- Won't work! In handlebars every time you enter a block your scope depth changes --}
{{#markdown}}
{{ figure.content }}
{{/markdown}}
{!-- Will work - need to use the ../ to move back up in scope --}
{{#markdown}}
{{ ../figure.content }}
@allmarkedup
allmarkedup / fractal.js
Last active February 19, 2016 21:34
Register handlebars helpers with Fractal
'use strict';
const fractal = require('@frctl/fractal');
const markdown = require('helper-markdown');
// other fractal config here...
fractal.engine('handlebars', '@frctl/handlebars-adapter', {
helpers: {
markdown: markdown()
@allmarkedup
allmarkedup / gist:3155969
Created July 21, 2012 14:35
default values for html checkboxes
<input type="text" name="my_input_name[0]" value="item_value" />
<input type="hidden" name="my_input_name[1]" value="unchecked_value" />
<input type="checkbox" name="my_input_name[1]" value="checked_value" />
@allmarkedup
allmarkedup / gist:3155968
Created July 21, 2012 14:34
default values for html checkboxes
<input type="hidden" name="checkbox_name" value="unchecked_value" />
<input type="checkbox" name="checkbox_name" value="checked_value" />
@allmarkedup
allmarkedup / gist:3155899
Created July 21, 2012 14:06
on variables and mixins in css
.bordered {
border-top: 1px dotted black;
border-bottom: 2px solid black;
}
.post a {
color: red;
.bordered;
}
@allmarkedup
allmarkedup / gist:3155891
Created July 21, 2012 14:03
on variables and mixins in css
@variables {
myCompanyBrandingColour: #F00;
myCompanyFonts: 'Comic Sans', Arial, sans-serif;
}
#header {
background-color: var(myCompanyBrandingColour);
}
p {
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<script>document.getElementsByTagName('html')[0].className += ' hasJS';</script>
<title>Blah</title>
</head>
<body>