Skip to content

Instantly share code, notes, and snippets.

View corychainsman's full-sized avatar

Cory Chainsman corychainsman

View GitHub Profile
@BashedCrab
BashedCrab / Hydrogen.py
Last active March 19, 2023 04:14
Hydrogen - A lightweight GUI framework for Pythonista
#
# Hydrogen is a lightweight GUI framework for Pythonista
#
# Hydrogen - https://gist.github.com/BashedCrab/5924965
#
# HydrogenLayouts - https://gist.github.com/BashedCrab/6103019
#
# HydrogenDemo - https://gist.github.com/BashedCrab/5953776
#
@marcboquet
marcboquet / Variables.plist
Created July 16, 2013 15:50
Soulver variables useful for iOS design. Based on ‏@marcedwards post: http://bjango.com/articles/soulver/
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SKVariables</key>
<array>
<dict>
<key>enabled</key>
<true/>
<key>name</key>
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/
# generate server.xml with the following command:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# run as follows:
# python simple-https-server.py
# then in your browser, visit:
# https://localhost:4443
import BaseHTTPServer, SimpleHTTPServer
import ssl
@swarminglogic
swarminglogic / watchfile.sh
Last active January 1, 2025 19:07
watchfile - monitor file(s) and execute a command when files are changed
#!/bin/bash
version=1.0.1
versionDate="2014-02-14"
function showHelp() {
echo "watchfile - monitor file(s)/command and perform action when changed
Possible ways of usage
----------------------------------------
@mindrones
mindrones / README.md
Last active August 29, 2015 13:58 — forked from mbostock/.block
Wrapping Long Labels (fork)

Fork of Wrapping Long Labels.

The difference is that we do a join to create the tspans, so that they have their own __data__, in case we want to use it. Here I color them based on their text length.

@jegtnes
jegtnes / Gulpfile.js
Created June 1, 2014 10:43
The Gulpfile I created for the blogpost http://jegtnes.co.uk/blog/using-gulp-with-uncss-in-ghost-for-tiny-assets/, detailing how to use UnCSS and Gulp for Ghost.
var gulp = require('gulp');
var sass = require('gulp-sass'); // skip this if you're working with vanilla CSS
var rename = require('gulp-rename');
var cmq = require('gulp-combine-media-queries');
var uncss = require('gulp-uncss');
var download = require('download');
var cssmin = require('gulp-cssmin');
var clean = require('gulp-clean');
var xml2js = require('gulp-xml2js');
@ofstudio
ofstudio / meta.hbs
Created January 6, 2015 13:43
Meta tags snippet for Ghost Themes
{{!-- Tested on Ghost 0.5.7. --}}
{{!-- IMPORTANT! Some things are more likely to work in a different way in future versions of Ghost. Check the documentation --}}
{{#is "index, tag, author"}} {{!-- Meta for index, tag and author contexts --}}
{{#is "index"}}
<title>{{@blog.title}}</title>
<meta name="description" content="{{@blog.description}}"/>
<meta property="og:title" content="{{@blog.title}}"/>
<meta itemprop="name" content="{{@blog.title}}"/>
{{/is}}
{{#is "tag"}}
@harej
harej / npg_gap_analysis.py
Last active June 9, 2016 21:20
Generates list of items and properties used on NPG-related Wikidata entries and assesses existence of labels in other languages
# Step 1: Get list of any Wikidata item with NPG ID and anything that is a subclass of chemical hazard
# Step 2: Iterate through each item for invoked items and properties
# (for claim in claims; for subclaim in claim: 'Q' + str(subclaim['mainsnak']['data-value']['value']['numeric-id'])
# and subclaim['mainsnak']['property'] where claim[0]['datatype'] == 'wikibase-item')
# Step 3: De-duplicate to generate exhaustive list of each item/property of interest to NIOSH
# Step 4: Check labels: en, es, zh, fr, de
# Step 5: Prepare HTML table that lists each item/property of interest, highlighting cells where values are missing
# Step 6: Take percentages of coverage in each language; save to a timestamped log
import requests
@veltman
veltman / README.md
Last active April 3, 2025 15:41
Sunburst to icicle #2

Transitioning between a sunburst and an icicle chart while preserving the chart dimensions by interpolating the difference in perimeter between the inner section and outer section until the difference is near zero.

Chrome currently has a rendering bug once the arcs' radii get really extreme, so this stops at about an 8-pixel difference.