Skip to content

Instantly share code, notes, and snippets.

View dmpe's full-sized avatar
💭
🎾

John dmpe

💭
🎾
View GitHub Profile
@dmpe
dmpe / backup.ps1
Created December 28, 2019 16:16
Azure Key Vault - Backup secrets using powershell (core) - Uses newer az Module
[string]$VaultName = 'keyvault'
Get-AzKeyVaultSecret -VaultName $VaultName |
ForEach-Object {
Backup-AzKeyVaultSecret `
-VaultName $VaultName `
-Name $_."Name" `
-OutputFile ('/home/jm/Documents/azure-keyvault-backups/{0}.blob' -f $_."Name")
}
@dmpe
dmpe / Dockerfile
Last active June 10, 2019 13:28
Neverfinished Dockerfile for jupyterhub with selected plugins/extensions. Using this nginx config and jupyter_conf.py I can guarantee that it is going to work on a Ubuntu server, on a subdomain.
############
### We must build our own image, conda is a no go
# https://gist.github.com/affixalex/97bc870e478b4f77a161e5fb2d63ec6d
# https://hub.docker.com/r/jupyterhub/jupyterhub/dockerfile
#######
FROM jupyterhub/jupyterhub:latest
USER root
RUN pip3 install oauthenticator ipywidgets nbdime ipyleaflet ipympl jupyterlab-git jupyterlab_sql jupyterlab_code_formatter \
@dmpe
dmpe / branch_cleanup.sh
Created May 24, 2019 00:47
delete remote and locale devel-cur-* branch
# https://stackoverflow.com/questions/2003505/how-do-i-delete-a-git-branch-locally-and-remotely
release_in_question="9.0.3.290.02"
future_release=""
git checkout master
# get latest from remote
git pull origin pull
@dmpe
dmpe / airquality.csv
Created February 22, 2018 16:16
Air quality New York data 1973 from datasets R library
Ozone Solar.R Wind Temp Month Day
1 41 190 7.4 67 5 1
2 36 118 8 72 5 2
3 12 149 12.6 74 5 3
4 18 313 11.5 62 5 4
5 NA NA 14.3 56 5 5
6 28 NA 14.9 66 5 6
7 23 299 8.6 65 5 7
8 19 99 13.8 59 5 8
9 8 19 20.1 61 5 9
@dmpe
dmpe / swiss_religion2.csv
Created January 5, 2018 18:35
swiss_religion2.csv
Catholic Place Protestant LabelCatholic LabelProtestant
1 9.96 Courtelary 90.04 Catholic 9.96 % Protestant 90.04 %
2 84.84 Delemont 15.16 Catholic 84.84 % Protestant 15.16 %
3 93.4 Franches-Mnt 6.6 Catholic 93.4 % Protestant 6.6 %
4 33.77 Moutier 66.23 Catholic 33.77 % Protestant 66.23 %
5 5.16 Neuveville 94.84 Catholic 5.16 % Protestant 94.84 %
6 90.57 Porrentruy 9.43 Catholic 90.57 % Protestant 9.43 %
7 92.85 Broye 7.15 Catholic 92.85 % Protestant 7.15 %
8 97.16 Glane 2.84 Catholic 97.16 % Protestant 2.84 %
9 97.67 Gruyere 2.33 Catholic 97.67 % Protestant 2.33 %
@dmpe
dmpe / swiss_Religion.csv
Created January 4, 2018 22:08
swiss_Religion.csv
We can make this file beautiful and searchable if this error is corrected: Any value after quoted field isn't allowed in line 1.
"";"Catholic";"Place";"Protestant";"LabelCatholic";"LabelProtestant"
"1";9,96;"Courtelary";90,04;"Catholic 9.96 %";"Protestant 90.04 %"
"2";84,84;"Delemont";15,16;"Catholic 84.84 %";"Protestant 15.16 %"
"3";93,4;"Franches-Mnt";6,6;"Catholic 93.4 %";"Protestant 6.6 %"
"4";33,77;"Moutier";66,23;"Catholic 33.77 %";"Protestant 66.23 %"
"5";5,16;"Neuveville";94,84;"Catholic 5.16 %";"Protestant 94.84 %"
"6";90,57;"Porrentruy";9,43;"Catholic 90.57 %";"Protestant 9.43 %"
"7";92,85;"Broye";7,15;"Catholic 92.85 %";"Protestant 7.15 %"
"8";97,16;"Glane";2,84;"Catholic 97.16 %";"Protestant 2.84 %"
"9";97,67;"Gruyere";2,33;"Catholic 97.67 %";"Protestant 2.33 %"
@dmpe
dmpe / BigTable.R
Created November 1, 2014 23:18
Analysis of Singapore's Education using three datasets
library("ggplot2")
source("PupilsPerTeacherRatio.R") # load our data
source("ExpenditurePerStudent_Pupils.R") # load the data
data = matrix(c(cleanedData.pupils$Years, cleanedData.pupils$ExpednInSD,
cleanedData.ratio$PupilsPerTeacher), ncol=3)
df = data.frame(data)
colnames(df) <- c("Year", "MoneySpend", "Ratio")
#TODO ggplot
@dmpe
dmpe / R version
Last active February 26, 2016 16:13
This shows a list of Python 3 installed packages which may need to be present in the system in order to reproduce our results.
Session info ------------------------------------------------------------------------------------------------------------------
setting value
version R version 3.2.3 (2015-12-10)
system x86_64, linux-gnu
ui RStudio (0.99.1054)
language en_US
collate en_US.UTF-8
tz <NA>
date 2016-02-07
@dmpe
dmpe / returnData.R
Created September 7, 2015 16:43
returnData.R used for benchmarking RSocrata row binding
# An interface to data hosted online in Socrata data repositories
# This is the main file which uses other functions to download data from a Socrata repositories
#
# Author: Hugh J. Devlin, Ph.D et al. 2013-08-28
###############################################################################
# library("httr") # for access to the HTTP header
# library("jsonlite") # for parsing data types from Socrata
# library("mime") # for guessing mime type
# library("geojsonio") # for geospatial json
final TimerTask messageLabelStrengthTimerTask = new TimerTask() {
@Override
public void run() {
Platform.runLater(new Runnable() {
@Override
public void run() {
rootGroup.getChildren().remove(
labelStrength);
}
});