Skip to content

Instantly share code, notes, and snippets.

View capncodewash's full-sized avatar

Graeme West capncodewash

  • Glasgow
View GitHub Profile
@jakeybob
jakeybob / generate_scot_std_pop_daily.R
Created June 7, 2021 20:22
Scotland standardised age/sex interpolated populations
library(tidyverse)
library(janitor)
library(lubridate)
library(zoo)
library(ckanr)
# generates age/sex population lookup for Scotland based on NRS mid-year
# population estimates/projections, interpolated linearly to day level
# (July 2nd used as mid-year reference date).
#
@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)
#
@jaredwinick
jaredwinick / README.md
Last active April 21, 2020 10:44
Apache Zeppelin Object Exchange for passing a DataFrame of feature vectors from the Scala Spark interpreter to PySpark to get a numpy array

Apache Zeppelin has a helpful feature in its Spark Interpreter called Object Exchange. This allows you to pass objects, including DataFrames, between Scala and Python paragraphs of the same notebook. You can do your data prep/feature engineering with the Scala Spark Interpreter, and then pass off a DataFrame containing the features to PySpark for use with libraries like NumPy and scikit-learn. Also with Zeppelin's support for matplotlib you have a pretty good setup for poking around and testing out machine learning on your data.

@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) }
@joepadmiraal
joepadmiraal / LICENSE.md
Last active December 21, 2020 16:41
Jenkins build status widget for Dashing

The MIT License (MIT)

Copyright (c) 2014 David Underwood

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

@christiangalsterer
christiangalsterer / README.md
Last active December 16, 2019 20:28
Atlassian Jira: Number of issues in a Jira Query Language (JQL) search

Description

A Dashing widget to display the number of issues returned by a Jira Query Language (JQL) search. The number of issues will be displayed using the Numbers widget. This widget is a generalized version of the Atlassian Jira: Number of issues in a Jira filter query widget, which shows the number of issues for saved Jira filter.

Dependencies

The following dependencies are required. Please add them to your dashing gemfile.

gem 'jira-ruby', :require => 'jira'
@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}$)
@mtowers
mtowers / README.md
Last active February 24, 2022 17:19
Google Analytics Website Visitor Count Widget for Dashing with OAuth2 Authentication
@gregology
gregology / dashboard
Last active December 8, 2020 14:19
Service script for dashing. Update DASHING_DIR variable, add this file to /etc/init.d/ , chmod to 755, and let update rc.d with $ sudo update-rc.d dashboard defaults This scripts stops the dashing service with "killall thin" which will kill all thin services running on your server.
#!/bin/bash
# Dashing service
# Add this file to /etc/init.d/
# $ sudo cp dashboard /etc/init.d/
# Update variables DASHING_DIR, GEM_HOME, & PATH to suit your installation
# $ sudo nano /etc/init.d/dashboard
# Make executable
# $ sudo chmod 755 /etc/init.d/dashboard
# Update rc.d
# $ sudo update-rc.d dashboard defaults
@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