Skip to content

Instantly share code, notes, and snippets.

// Simplest component: stateless function.
function Hello(props) {
return (
<div className="txt-bold">
Hello {props.name}
</div>
);
}
// Without JSX.
'use strict';
const mapnik = require('mapnik');
const VectorTile = require('vector-tile').VectorTile;
const Protobuf = require('pbf');
const fs = require('fs');
mapnik.register_default_input_plugins();
const geojson = fs.readFileSync('original-russian-triangle.geojson', 'utf8');
var VectorTile = require('vector-tile').VectorTile;
var Protobuf = require('pbf');
var fs = require('fs');
var path = require('path');
var data = fs.readFileSync(path.join(__dirname, './pbfs/river.vector.pbf'));
var tile = new VectorTile(new Protobuf(data));
var layer = tile.layers['russian-river'];
'use strict';
var fs = require('graceful-fs');
var Promise = require('pinkie-promise');
var yaml = require('js-yaml');
var parseJson = require('parse-json');
var requireFromString = require('require-from-string');
module.exports = function(configPath, configFormat) {
return new Promise(function(resolve) {
var pathmodify = require('pathmodify')
var browserify = require('browserify')
browserify('./index.js')
.plugin(pathmodify(), {
mods: [
pathmodify.mod.dir('foo', './test/foo')
]
})
.bundle();
@davidtheclark
davidtheclark / idea.md
Last active August 29, 2015 14:15
available browser info module idea

There are several modules that do the following:

  1. locate available browsers on the current machine;
  2. do something with that information.

Usually #2 is "launch the browser with some specific content", but not always.

The modules I have in mind (of course there may be more!) are:

# For SCSS-Lint v0.31.0
linters:
BangFormat:
enabled: true
space_before_bang: true
space_after_bang: false
BorderZero:
@davidtheclark
davidtheclark / snippet.cson
Last active January 31, 2019 01:01
Freemarker snippets for Atom Editor
# First install Freemarker language support with https://github.com/niltonheck/language-freemarker
'.text.html.ftl':
'Freemarker if':
'prefix': 'if'
'body': """
[#if ${1:condition}]
$2
[/#if]
"""
@davidtheclark
davidtheclark / SassMeister-input.scss
Created August 2, 2014 18:01
Generated by SassMeister.com.
// ----
// libsass (v2.0.0)
// ----
@mixin first {
/* first mixin was included */
body {
font-size: 100px;
}
}
@davidtheclark
davidtheclark / test-extends.scss
Created April 5, 2014 23:04
for comparing gzipping of Sass extends and mixins
@import "../bower_components/scut/dist/scut";
@for $i from 1 through 200 {
.test-#{$i} {
@extend %scut-hide-visually;
@extend %scut-image-replace;
@extend %scut-triangle;
@extend %scut-clearfix;
@extend %scut-fill;
@extend %scut-list-unstyled;