Skip to content

Instantly share code, notes, and snippets.

html {
font-size: 18px;
line-height: 1.5;
@include breakpoint(mama-bear) {
font-size: 15px;
}
@include breakpoint(baby-bear) {
font-size: 13px;
}
}
import chalk from 'chalk';
const logLevelName = process.env.LOG_LEVEL;
const isProd = process.env.NODE_ENV === 'production';
const isServer = typeof window === 'undefined';
const INFO = 20;
const WARN = 30;
const ERROR = 40;
const logLevels = {
@davidgilbertson
davidgilbertson / server.js
Created September 7, 2015 10:54
Using the log util and setting the namespace
const log = require('../utils/log.js')('server:routes');
log.info('Something wonderful has happened.');
// "server:routes > Something wonderful has happened"
const log = require('./log.js')('http:request');
export default (req, nes, next) => {
const httpRequest = {
method: req.method,
url: req.url,
headers: req.headers,
remoteAddress: req.connection.remoteAddress,
remotePort: req.connection.remotePort
};
@davidgilbertson
davidgilbertson / Screen-styles.js
Last active April 25, 2016 01:54
Styles example
import CSS from '../../utils/css.js';
export default {
main: {
position: 'absolute',
width: 1366,
height: 768,
top: 60,
left: '50%',
transform: 'translateX(-50%)',
import React from 'react';
export default () => (
<svg width="22" height="22" viewBox="0 0 1024 1024">
<path d="M192 1024h640l64-704h-768zM640 128v-128h-256v128h-320v192l64-64h768l64 64v-192h-320zM576 128h-128v-64h128v64z"></path>
</svg>
);
// this is the selection.json file from IcoMoon, with "export default" added at the start and renamed from '.json' to '.js';
export default {
"IcoMoonType": "selection",
"icons": [
{
"icon": {
"paths": [
"M192 1024h640l64-704h-768zM640 128v-128h-256v128h-320v192l64-64h768l64 64v-192h-320zM576 128h-128v-64h128v64z"
],
import React from 'react';
const {PropTypes} = React;
const icons = {
trash: 'M192 1024h640l64-704h-768zM640 128v-128h-256v128h-320v192l64-64h768l64 64v-192h-320zM576 128h-128v-64h128v64z',
facebook: 'M608 192h160v-192h-160c-123.514 0-224 100.486-224 224v96h-128v192h128v512h192v-512h160l32-192h-192v-96c0-17.346 14.654-32 32-32z',
};
const Icon = props => (
<svg width="22" height="22" viewBox="0 0 1024 1024">
// These are the paths taken from IcoMoon's `selection.json` file.
// Where there were multiple paths (e.g. the linkedIn icon) they can be concatenated with a space
export default {
'bubble': 'M512 64c282.77 0 512 186.25 512 416 0 229.752-229.23 416-512 416-27.156 0-53.81-1.734-79.824-5.044-109.978 109.978-241.25 129.7-368.176 132.596v-26.916c68.536-33.578 128-94.74 128-164.636 0-9.754-0.758-19.33-2.164-28.696-115.796-76.264-189.836-192.754-189.836-323.304 0-229.75 229.23-416 512-416z',
'enlarge2': 'M1024 0v416l-160-160-192 192-96-96 192-192-160-160zM448 672l-192 192 160 160h-416v-416l160 160 192-192z',
'shrink2': 'M448 576v416l-160-160-192 192-96-96 192-192-160-160zM1024 96l-192 192 160 160h-416v-416l160 160 192-192z',
'bin2': 'M192 1024h640l64-704h-768zM640 128v-128h-256v128h-320v192l64-64h768l64 64v-192h-320zM576 128h-128v-64h128v64z',
'cloud-check': 'M892.268 514.49c2.442-11.108 3.732-22.646 3.732-34.49 0-88.366-71.634-160-160-160-14.224 0-28.014 1.868-41.134 5.352-24.796-77.352-97.288-133.352-
import React from 'react';
const {PropTypes} = React;
const icons = {
'bin2': 'M192 1024h640l64-704h-768zM640 128v-128h-256v128h-320v192l64-64h768l64 64v-192h-320zM576 128h-128v-64h128v64z',
'facebook': 'M608 192h160v-192h-160c-123.514 0-224 100.486-224 224v96h-128v192h128v512h192v-512h160l32-192h-192v-96c0-17.346 14.654-32 32-32z',
};
const Icon = props => (
<svg width="22" height="22" viewBox="0 0 1024 1024">