This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Simplest component: stateless function. | |
function Hello(props) { | |
return ( | |
<div className="txt-bold"> | |
Hello {props.name} | |
</div> | |
); | |
} | |
// Without JSX. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
No jQuery necessary. | |
Thanks to Dan's StackOverflow answer for this: | |
http://stackoverflow.com/questions/123999/how-to-tell-if-a-dom-element-is-visible-in-the-current-viewport | |
*/ | |
function isElementInViewport(el) { | |
var rect = el.getBoundingClientRect(); | |
return ( | |
rect.top >= 0 && |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def dumb_to_smart_quotes(string): | |
"""Takes a string and returns it with dumb quotes, single and double, | |
replaced by smart quotes. Accounts for the possibility of HTML tags | |
within the string.""" | |
# Find dumb double quotes coming directly after letters or punctuation, | |
# and replace them with right double quotes. | |
string = re.sub(r'([a-zA-Z0-9.,?!;:\'\"])"', r'\1”', string) | |
# Find any remaining dumb double quotes and replace them with | |
# left double quotes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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] | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For SCSS-Lint v0.31.0 | |
linters: | |
BangFormat: | |
enabled: true | |
space_before_bang: true | |
space_after_bang: false | |
BorderZero: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@font-face { | |
font-family:"icon"; | |
src:url("../fonts/icon.eot"); | |
src:url("../fonts/icon.eot?#iefix") format("embedded-opentype"), | |
url("../fonts/icon.woff") format("woff"), | |
url("../fonts/icon.ttf") format("truetype"), | |
url("../fonts/icon.svg?#webfont") format("svg"); | |
font-weight:normal; | |
font-style:normal; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mblConnect = { | |
$cont: $('#connect'), | |
$site: $('#site'), | |
isOpen: false, | |
$overlay: $('<div id="mbl-overlay" class="mbl-overlay js-connect-btn" />'), | |
_getBtns: function () { | |
return $('.js-connect-btn'); | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Generated by grunt-webfont */ | |
<% if (fontfaceStyles) { %>@font-face { | |
font-family:"<%= fontBaseName %>";<% if (eot) { %> | |
src:<%= fontSrc1 %>;<% }%> | |
src:<%= fontSrc2 %>; | |
font-weight:normal; | |
font-style:normal; | |
} | |
<% } %> |
NewerOlder