Skip to content

Instantly share code, notes, and snippets.

View capncodewash's full-sized avatar

Graeme West capncodewash

  • Glasgow
View GitHub Profile
@jmcastagnetto
jmcastagnetto / echarts4r-treemap-example.R
Last active November 18, 2021 15:22
Example of use of echarts4r to make a treemap
# based on the example at: https://echarts4r.john-coene.com/articles/chart_types.html#treemap
# the JS example at: https://echarts.apache.org/examples/en/editor.html?c=treemap-show-parent
# and the documentation at: https://echarts.apache.org/en/option.html#series-treemap.type
library(tidyverse)
library(echarts4r)
# this data structure does not work with the changed function
# set.seed(13579)
#
@mtowers
mtowers / README.md
Last active February 24, 2022 17:19
Google Analytics Website Visitor Count Widget for Dashing with OAuth2 Authentication
@calclavia
calclavia / gist:60b30c497adce5587f70
Last active March 16, 2022 18:35 — forked from RX14/gist:6e04cd9fc71c52191def
Create property file with Gradle
def propertyFile = file "src/main/resources/META-INF/some.properties"
def props = new Properties()
propertyFile.withReader { props.load(it) }
props.setProperty("version", project.version)
propertyFile.withWriter { props.store(it) }
@coderoshi
coderoshi / gist:3729593
Last active March 31, 2022 15:43
A Very Short Guide to Writing Guides

A Very Short Guide to Writing Guides

This is just a few thoughts on the topic of writing technical guides. This was intended for Basho's engineering team, but this may apply to open source projects in general.

Audience

It's commonly preached that the first step in writing is to identify your audience; to whom are you writing? This is the most well known, most repeated, and most overlooked step of writing in general and technical writing in particular. Take this document, for example. My audience is technical people who need to communicate technical information, and not teenagers, so I shy away from images of pop icons and memes. I use jargon and words like "identify" rather than "peep this".

Pronouns

@SEJeff
SEJeff / settings_logging.py
Created July 8, 2011 22:19
How to enable debug logging for django_auth_ldap
############################## django-auth-ldap ##############################
if DEBUG:
import logging, logging.handlers
logfile = "/tmp/django-ldap-debug.log"
my_logger = logging.getLogger('django_auth_ldap')
my_logger.setLevel(logging.DEBUG)
handler = logging.handlers.RotatingFileHandler(
logfile, maxBytes=1024 * 500, backupCount=5)
@danielrbradley
danielrbradley / uk-number-plate-validation.md
Last active April 27, 2024 14:04
Regular Expression to Validate UK Number Plates

Regular Expression to Validate UK Number Plates

Regular Expression

(?<Current>^[A-Z]{2}[0-9]{2}[A-Z]{3}$)|(?<Prefix>^[A-Z][0-9]{1,3}[A-Z]{3}$)|(?<Suffix>^[A-Z]{3}[0-9]{1,3}[A-Z]$)|(?<DatelessLongNumberPrefix>^[0-9]{1,4}[A-Z]{1,2}$)|(?<DatelessShortNumberPrefix>^[0-9]{1,3}[A-Z]{1,3}$)|(?<DatelessLongNumberSuffix>^[A-Z]{1,2}[0-9]{1,4}$)|(?<DatelessShortNumberSufix>^[A-Z]{1,3}[0-9]{1,3}$)|(?<DatelessNorthernIreland>^[A-Z]{1,3}[0-9]{1,4}$)|(?<DiplomaticPlate>^[0-9]{3}[DX]{1}[0-9]{3}$)

For use in JavaScript (with named groups removed):

(^[A-Z]{2}[0-9]{2}\s?[A-Z]{3}$)|(^[A-Z][0-9]{1,3}[A-Z]{3}$)|(^[A-Z]{3}[0-9]{1,3}[A-Z]$)|(^[0-9]{1,4}[A-Z]{1,2}$)|(^[0-9]{1,3}[A-Z]{1,3}$)|(^[A-Z]{1,2}[0-9]{1,4}$)|(^[A-Z]{1,3}[0-9]{1,3}$)|(^[A-Z]{1,3}[0-9]{1,4}$)|(^[0-9]{3}[DX]{1}[0-9]{3}$)