Skip to content

Instantly share code, notes, and snippets.

@cuppster
cuppster / README.md
Created September 12, 2020 14:50 — forked from klokan/README.md
NASA Blue Marble

NASA Blue Marble

Prepared for MapTiler: http://www.maptiler.com/ or other GDAL tools

GDAL vrt

Download the high-resolution images from http://visibleearth.nasa.gov/view.php?id=73751

wget http://eoimages.gsfc.nasa.gov/images/imagerecords/73000/73751/world.topo.bathy.200407.3x21600x21600.A1.jpg
wget http://eoimages.gsfc.nasa.gov/images/imagerecords/73000/73751/world.topo.bathy.200407.3x21600x21600.A2.jpg
@cuppster
cuppster / README.md
Created September 12, 2020 14:50 — forked from klokan/README.md
NASA Blue Marble

NASA Blue Marble

Prepared for MapTiler: http://www.maptiler.com/ or other GDAL tools

GDAL vrt

Download the high-resolution images from http://visibleearth.nasa.gov/view.php?id=73751

wget http://eoimages.gsfc.nasa.gov/images/imagerecords/73000/73751/world.topo.bathy.200407.3x21600x21600.A1.jpg
wget http://eoimages.gsfc.nasa.gov/images/imagerecords/73000/73751/world.topo.bathy.200407.3x21600x21600.A2.jpg
@cuppster
cuppster / dms2dec.py
Last active August 29, 2015 14:20 — forked from tomwhipple/dms2dec.py
#!/env/python
# coding=utf8
"""
Converting Degrees, Minutes, Seconds formatted coordinate strings to decimal.
Formula:
DEC = (DEG + (MIN * 1/60) + (SEC * 1/60 * 1/60))
Assumes S/W are negative.
@cuppster
cuppster / ShortGUID.cs
Last active August 29, 2015 14:03
Create short GUIDs with a custom alphabet
using System;
using System.Numerics;
namespace Cuppster
{
/// <summary>
/// converted from the python version at https://github.com/stochastic-technologies/shortuuid
/// </summary>
class ShortUUID
{
<link rel="import" href="../components/polymer/polymer.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
@cuppster
cuppster / Adorners.cs
Last active August 29, 2015 14:03
Technique using a binding converter to return an object representing viewmodel state for displaying an adorner.
using System;
using System.Globalization;
using System.Windows.Data;
namespace WpfApplication1
{
/*
see: http://cuppster.com/2014/07/10/using-the-state-pattern-for-adorning-in-xaml/
@cuppster
cuppster / DocModule.cs
Created July 5, 2014 21:46
DocModule.cs
using Nancy;
namespace MyApi
{
public class DocModule : NancyModule
{
public DocModule()
{
Get ["/doc"] = _ => {
return View ["index.html"];
@cuppster
cuppster / flask_gridfs_images.py
Created March 12, 2013 18:24
Recipe for downloading images into a mongoDB gridfs collection, then serving the images with a Flask application. No temp files created.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
SYNOPSIS
flask_gridfs_images.py --start
flask_gridfs_images.py --add <IMAGE_URL>
DESCRIPTION
@cuppster
cuppster / template.js
Last active October 11, 2023 20:06
Template backbone.js code that encapsulates a datatable.net table within a view for a hypothetical auction listings application.
/*
* Template backbone.js code that encapsulates a
* datatable.net table within a view for a hypothetical ;)
* auction listings application.
*/
var HomeRouter = Backbone.Router.extend({
routes: {
'refresh' : 'refresh',
@cuppster
cuppster / getcomics.py
Created January 30, 2013 06:18
Mini-framework for scraping web pages with python using PyQuery, decorators and generators.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys, re
import itertools
from functools import wraps
from pyquery import PyQuery as pq
class scrape: