Skip to content

Instantly share code, notes, and snippets.

View mdgart's full-sized avatar

Mauro De Giorgi mdgart

  • Boulder - Colorado
View GitHub Profile
@mdgart
mdgart / money_cleanup.py
Created June 27, 2014 16:27
Extract integer numeric part from a string representing a money value, for example "$1,000.00" -> 1000, it cuts the decimal
amount = "$1,000.00"
numeric_amount = int("".join(re.findall(r'\d', amount.split(".")[0])))
@mdgart
mdgart / designer.html
Last active August 29, 2015 14:08
designer
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../google-map/google-map.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
@mdgart
mdgart / prettyjson.js
Last active August 29, 2015 14:21
Angular filter to convert a string to JSON object and the prettify it using angular toJson function, use white-space: pre-wrap; CSS to maintain formatting in template.
'use strict';
angular.module('jsonFilters', []).filter('prettyjson', function() {
return function(input) {
return angular.toJson(JSON.parse(input), true);
};
});