Skip to content

Instantly share code, notes, and snippets.

Keith Daulton d13

Block or report user

Report or block d13

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@d13
d13 / app.html
Last active Oct 16, 2018
Aurelia Gist - nav in a LayoutView
View app.html
<template>
<require from="nav-bar.html"></require>
<!-- this nav works -->
<nav-bar router.bind="router"></nav-bar>
<div class="page-host" style="margin-top:50px">
<router-view router.bind="router"></router-view>
</div>
</template>
@d13
d13 / icecream-sandwich.less
Last active Feb 16, 2017
LESS: Mixing variables into caller's scope
View icecream-sandwich.less
@import "vars";
@import "mixins";
.vanilla-sandwich {
.vanilla-config();
.icecream-sandwich();
}
.neopolitan-sandwich {
.neopolitan-config();
@d13
d13 / app.html
Created Sep 1, 2016 — forked from jdanyow/app.html
Aurelia Gist
View app.html
<template>
<h1>${message}</h1>
</template>
@d13
d13 / XmlPoster.js
Last active Apr 1, 2016
Node.js: Simple XML API requests
View XmlPoster.js
var request = require('request');
var assign = require('lodash.assign');
var XmlPoster = function(options) {
this.url = options.url;
this.headers = options.headers || {};
};
XmlPoster.prototype.request = function(body) {
var me = this;
var xmlConfig = {
@d13
d13 / README.md
Created Feb 25, 2016 — forked from jedireza/README.md
ajaxStart and ajaxStop for ampersand-model using the ajaxConfig
View README.md

Also see the discussion about global ajax settings:

Add support for a global ajaxConfig Thus far we've just gone for having a base model and base collection in every project.

@d13
d13 / gist:6423256
Created Sep 3, 2013
quick styling for exported Chrome bookmarks
View gist:6423256
<style>
* { margin:0; padding:0; }
body { margin:10px; }
dl { border:1px solid #eaeaea; padding:10px; margin-bottom:10px; }
/* dl > * { margin-left:10px; } */
dl h3 {
background:#f6f6f6;
padding:5px;
border:1px solid #eaeaea;
border-bottom:none;
@d13
d13 / mq.less
Last active Oct 15, 2015
retina media-query
View mq.less
.m-mq(@query, @ruleset) {
@media @query {
@ruleset();
}
};
.m-mq-retina(@ruleset) {
@query: ~"only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min--moz-device-pixel-ratio: 1.5), only screen and (-o-min-device-pixel-ratio: 3/2), only screen and (min-device-pixel-ratio: 1.5), only screen and (min-resolution: 192dpi)";
.m-mq(@query, @ruleset);
};
.icon-foo {
@d13
d13 / buildTmpl.js
Created Jul 29, 2015
Quick n' Dirty Mustache Variable Replacement
View buildTmpl.js
/**
* Function that replaces mustache variables in a string with values from the data object
* @param {String} tmpl String with the variables to be replaced
* @param {Object} data Object with data to be populated
* @return {String} Returns a string with mustache variables replaced
*/
var buildTmpl = function(tmpl, data) {
if (!data) {
return tmpl;
}
@d13
d13 / notepad-bookmarklet
Last active Aug 29, 2015
Notepad bookmarklet I made a while ago with Behave.js
View notepad-bookmarklet
data:text/html, <html><head><style type="text/css"> html { font-family: Arial } </style><script src="http://jakiestfu.github.com/Behave.js/behave.js"></script><script>window.onload=function(){var editor = new Behave({textarea: document.getElementById('myTextarea')});};</script></head><body><textarea id="myTextarea" style="width:100%;height:100%;margin:0 auto;padding:1rem;font-size:1rem; border: none; outline: none" autofocus></textarea></body>
@d13
d13 / 1-source.less
Last active Aug 29, 2015
LESS and BEM experiment
View 1-source.less
#BEM {
.glue(@glue, @selector, @styles) {
&@{glue}@{selector} {
@styles();
}
}
.e(@name, @styles) {
#BEM > .glue(__, @name, @styles);
}
.m(@name, @styles) {
You can’t perform that action at this time.