Faux-3d SVG globe using d3.geo.orthographic and a few radial gradients. Labels offset or hidden based on radians from current map center to enhance the effect.
Uncomment svg.append("g").attr("class","countries") for hover-able country outlines.
<button id="deleteDevice" class="btn btn-danger btn-xs" | |
data-link="{{ url_for('monitor.delete_device', id_device=device.id_device) }}"> | |
<span class="glyphicon glyphicon-remove-circle"></span> | |
Delete Device | |
</button> | |
<script type="text/javascript"> | |
var t = document.getElementById('deleteDevice'); | |
t.addEventListener('click', function () { | |
deleteDevice(t.dataset.link); |
from geventwebsocket.handler import WebSocketHandler | |
from gevent.pywsgi import WSGIServer | |
from flask import Flask, request, render_template | |
app = Flask(__name__) | |
@app.route('/') | |
def index(): | |
return render_template('index.html') |
# !/usr/bin/env python | |
import os | |
import argparse | |
from app import create_app | |
from flask.ext.script import Manager | |
parser = argparse.ArgumentParser() | |
parser.add_argument("go", help="runserver, test, shell") |
import arrow | |
print(tarrow.utcnow().replace(days=-1)) | |
# 2014-10-06T12:09:34.152402+00:00 | |
print(tarrow.utcnow().replace(months=-1)) | |
# 2014-09-13T12:09:34.152573+00:00 | |
print(tarrow.utcnow().replace(months=-3)) | |
# 2014-07-13T12:09:34.152685+00:00 |
function responsiveImages($string, $attr) { | |
$output = "<div id=\"responsive-gallery-test\">"; | |
$posts = get_posts(array('include' => $attr['ids'], 'post_type' => 'attachment')); | |
foreach ($posts as $image) { | |
$output .= "<img data-img-small='" . wp_get_attachment_image_src($image->ID, 'thumbnail')[0] . "'" . | |
" data-img-medium='" . wp_get_attachment_image_src($image->ID, 'medium')[0] . "''" . | |
" data-img-large='" . wp_get_attachment_image_src($image->ID, 'large')[0] . "''" . | |
" data-img-full='" . wp_get_attachment_image_src($image->ID, 'full')[0] . "'/>"; | |
} |
import glob | |
import email | |
if __name__ == '__main__': | |
files = glob.glob("/Users/wiesson/Downloads/mails/*.eml") | |
for each in files: | |
msg = email.message_from_file(open(each)) | |
attachments = msg.get_payload() | |
for attachment in attachments: | |
try: |
(moment('2015-04-25').add(6, 'months')).diff(moment(), 'days') |
add_image_size('img-l', 1024, 702); | |
add_image_size('img-m', 768, 372); | |
add_image_size('img-s', 480, 320); | |
add_image_size('img-xs', 320, 200); | |
/** | |
* Get WP Attachment as responsive background image | |
* @param int $id | |
* @return string | |
*/ |
Faux-3d SVG globe using d3.geo.orthographic and a few radial gradients. Labels offset or hidden based on radians from current map center to enhance the effect.
Uncomment svg.append("g").attr("class","countries") for hover-able country outlines.