Skip to content

Instantly share code, notes, and snippets.

View dantman's full-sized avatar

Daniel Friesen dantman

View GitHub Profile
@dantman
dantman / gist.css
Last active April 17, 2018 22:07
Material Design sp units (px unit that scale to the user's font settings) using rems
html {
font-size: 14px;
}
/**
* PostCSS
* Use a custom PostCSS to convert #sp to rems by dividing the number by 14 and expressing it as #rem
*/
body {
@dantman
dantman / transform-is-browser.js
Created January 9, 2016 05:33
require('is-browser') transform
.transform(transformTools.makeRequireTransform(
{evaluateArguments: true},
(args, opts, cb) => {
if ( args[0] === "is-browser" ) {
return cb(null, 'true');
} else {
return cb();
}
}))
@dantman
dantman / regenerator-runtimeify.js
Last active January 9, 2016 05:22
Transform modules using regenerator-runtime
.transform(transformTools.makeStringTransform(
'regenerator-runtimeify',
{jsFilesOnly: true},
(contents, transformOptions, done) => {
if ( contents.includes('regeneratorRuntime') ) {
contents = contents.replace(
/(['"']use strict['"'];?\n?)/,
"$1\nvar regeneratorRuntime = require('regenerator/runtime');\n");
}
@dantman
dantman / .babelrc
Last active December 24, 2015 21:03
{
"presets": ["es2015", "stage-1"]
}
@dantman
dantman / git.diff
Created December 14, 2015 01:58
Juice styleFilter patch
diff --git a/client.js b/client.js
index 9deb594..44488de 100644
--- a/client.js
+++ b/client.js
@@ -282,7 +282,7 @@ function inlineContent(html, css, options) {
function getStylesData($, options) {
var results = [];
var stylesList = $("style");
- var styleDataList, styleData, styleElement;
+ var styleDataList, styleData, styleElement, filterResult;
Anonymous UUID: E3BDDC68-FEB5-8FE4-33CF-270703B78232
Thu Oct 1 10:57:33 2015
panic(cpu 0 caller 0xffffff802a475d4d): "missing pager for copy object"@/SourceCache/xnu/xnu-2422.115.14/osfmk/vm/vm_pageout.c:794
Backtrace (CPU 0), Frame : Return Address
0xffffff8031dc3b30 : 0xffffff802a423139
0xffffff8031dc3bb0 : 0xffffff802a475d4d
0xffffff8031dc3d50 : 0xffffff802a478f14
0xffffff8031dc3f20 : 0xffffff802a4dd05c
0xffffff8031dc3fb0 : 0xffffff802a4f438b
{
"countries": {
"AD": {
"name": "Andorra",
"abbr": "AD",
"zones": [
"Europe/Andorra"
]
},
"AE": {
@dantman
dantman / app.js
Last active August 29, 2015 14:21
"use strict";
var contrivedFoo = require('./contrivedFoo');
contrivedFoo.foo();
"use strict";
var createObject = require('./createObject');
var contrivedExample = createObject( 42 );
#!/usr/bin/env node
"use strict";
process.bin = process.title = 'mediawiki-extensionservice-cron';
require('../lib/check-env');
var Promise = require('bluebird');
Promise.longStackTraces();
var _ = require('lodash'),
fmt = require('util').format,
chalk = require('chalk'),