Skip to content

Instantly share code, notes, and snippets.

@tsemerad
tsemerad / Webpack config for Mapbox GL JS
Last active June 17, 2016 00:44
Partial Webpack config set up for use with Mapbox GL JS
// This is not a great example of a working webpack config, but works for me for use with Mapbox GL JS
var webpack = require('webpack');
var path = require('path');
var fs = require('fs');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var StatsPlugin = require('stats-webpack-plugin');
var loadersByExtension = require('./loaders-by-extension');
var Col = require('react-bootstrap/lib/Col')
var PageHeader = require('react-bootstrap/lib/PageHeader')
var React = require('react')
var Row = require('react-bootstrap/lib/Row')
var {connect} = require('react-redux')
var {reduxForm} = require('redux-form')
var DateInput = require('./DateInput')
var FormField = require('./FormField')
var LoadingButton = require('./LoadingButton')
{% macro form_field(field) -%}
{% set with_label = kwargs.pop('with_label', False) %}
{% set placeholder = '' %}
{% if not with_label %}
{% set placeholder = field.label.text %}
{% endif %}
<div class="control-group {% if field.errors %}error{% endif %}">
{% if with_label %}
<label for="{{ field.id }}" class="control-label">
{{ field.label.text }}{% if field.flags.required %} *{% endif %}:
@tsemerad
tsemerad / dms_to_dd.py
Created February 28, 2013 01:15
Python function for converting degrees, minutes, seconds (DMS) coordinates to decimal degrees (DD).
def dms_to_dd(d, m, s):
dd = d + float(m)/60 + float(s)/3600
return dd