Skip to content

Instantly share code, notes, and snippets.

@psd
psd / sts
Created September 30, 2010 14:57
send files to TiddlySpace
#!/bin/sh
# cheap and cheerful pushing of files to TiddlySpace,
# authorization taken from the variable TIDDLYSPACE_AUTH which for me is:
# export TIDDLYSPACE_AUTH='-u myuser:mypass'
# usage: sts spacename file1 file2 ..
space="$1" ; shift
# public/private
@BenJam
BenJam / preloadImages.js
Created April 25, 2011 20:59
Beautifully simple image preloader, sequenced and namespaced
preloadImages = {
count: 0 /* keep track of the number of images */
,loaded: 0 /* keeps track of how many images have loaded */
,onComplete: function(){} /* fires when all images have finished loadng */
,onLoaded: function(){} /*fires when an image finishes loading*/
,loaded_image: "" /*access what has just been loaded*/
,images: [] /*keeps an array of images that are loaded*/
,incoming:[] /*this is for the process queue.*/
/* this will pass the list of images to the loader*/
@mahemoff
mahemoff / MOVED
Created February 10, 2012 17:05
JSON cities lat-lon (moved)
Made this a proper GitHub Repo:
https://github.com/mahemoff/geodata
@davatron5000
davatron5000 / gist:2254924
Created March 30, 2012 20:57
Static Site Generators

Backstory: I decided to crowdsource static site generator recommendations, so the following are actual real world suggested-to-me results. I then took those and sorted them by language/server and, just for a decent relative metric, their Github Watcher count. If you want a heap of other projects (including other languages like Haskell and Python) Nanoc has the mother of all site generator lists. If you recommend another one, by all means add a comment.

Ruby

@dideler
dideler / pyargs.md
Last active January 23, 2023 16:39
Parsing Command-Line Argument in Python

Command-line arguments in Python show up in sys.argv as a list of strings (so you'll need to import the sys module).

For example, if you want to print all passed command-line arguments:

import sys
print(sys.argv)  # Note the first argument is always the script filename.

Command-line options are sometimes passed by position (e.g. myprogram foo bar) and sometimes by using a "-name value" pair (e.g. myprogram -a foo -b bar).

@chadclark
chadclark / 01-bg-img-path.scss
Last active December 16, 2015 21:20
A .scss mixin that makes it easy to include a .png fallback for .svg background images when using Modernizr.
// ---------------------------------------------------------------------------------
// CSS Image Paths
// ---------------------------------------------------------------------------------
$bg-img-path: '/path/to/images/'; // Base Path for BG Layout Images
@mathiasrw
mathiasrw / True Trello Printer
Last active February 27, 2024 21:21
Ever wanted to print your Trello board? Export as JSON and paste it into the code.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>True Trello Printer</title>
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
<style>
body{margin:15%;}
.panel-body{
@edwardhorsford
edwardhorsford / govuk_service_email_template
Last active April 19, 2016 15:07
GOV.UK service email template
<html>
<head>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta content="utf-8" http-equiv="encoding">
<!-- This disables auto detection of phone numbers in some clients. Remove if not needed. -->
<meta name="format-detection" content="telephone=no">
<title>Page title</title>
</head>
<body style="font-family: Helvetica, Arial, sans-serif;font-size: 16px;margin: 0;color:#0b0c0c">
@nkbt
nkbt / .eslintrc.js
Last active May 11, 2024 13:03
Strict ESLint config for React, ES6 (based on Airbnb Code style)
{
"env": {
"browser": true,
"node": true,
"es6": true
},
"plugins": ["react"],
"ecmaFeatures": {
@psd
psd / wfs.py
Created June 4, 2018 09:57
Grab GML from a WFS server
#!/usr/bin/env python3
"""
https://geopython.github.io/OWSLib/
"""
from owslib.wfs import WebFeatureService
url='http://inspire.misoportal.com/geoserver/mid_sussex_district_council_msdc_3830_tpo_point/wfs?service=wfs&version=2.0.0&request=GetCapabilities'
url='http://environment.data.gov.uk/ds/wfs?INTERFACE=ENVIRONMENTWFS--7a955570-d465-11e4-a37c-f0def148f590'