Skip to content

Instantly share code, notes, and snippets.

View allmarkedup's full-sized avatar

Mark Perkins allmarkedup

View GitHub Profile
{
"context": {
"bar": {
"title": "Title for Bar"
},
"baz": {
"title": "Title for BaZ"
}
}
}
@allmarkedup
allmarkedup / fractal.js
Created April 6, 2016 15:28
Run gulp tasks from within the Fractal interactive CLI interface
'use strict';
const fractal = require('@frctl/fractal');
const gulp = require('./gulpfile');
fractal.command('gulp [task]', function(args, done){
const task = args.task || 'default';
this.console.notice(`Running gulp '${task}' task...`);
gulp.start(task, err => {
if (err) {
@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;
}