Skip to content

Instantly share code, notes, and snippets.

View geneorama's full-sized avatar

Gene Leynes geneorama

View GitHub Profile
geneorama / gist:c38573682aac4ec0d131451ca5a04f65
Created July 2, 2021 17:21
WinScp error for ppk conversion
View gist:c38573682aac4ec0d131451ca5a04f65
$ /keygen id_rsa_xyz.pem /output=id_rsa_xyz.ppk
Scripting does not use standalone parameters. The parameters you have specified on command-line will not be used. Your command-line syntax is probably wrong.
Opening session using command-line parameter in scripting is deprecated. Use 'open' command instead.
Searching for host...
Host "C" does not exist.
winscp> exit
geneorama / chicovidcasevsothers.R
Created October 27, 2020 21:14
Yet another COVID 19 map - Chicago area cases, hospitalizations, and deaths (normalized for peak)
View chicovidcasevsothers.R
## Author Gene Leynes
## Date: Oct 27, 2020
## Best run with R (Free) in R Studio (Free)
## Download R and R Studio to reproduce.
## Available for windows, mac, linux
## If you don't have these packages you can install them with this code:
## install.packages("data.table")
## install.packages("magrittr")
geneorama / wardmap.R
Last active May 30, 2022 22:04
Plot Chicago ward map with labels that are actually in the wards
View wardmap.R
library(geneorama) ## Not actually needed
View interactive_map_tutorial.Rmd
title: "Making Interactive Maps of Public Data in R"
author: "Ryan Rosenberg"
output: html_document
.leaflet {
margin: auto;
geneorama /
Last active December 6, 2018 20:12
msysgit readme

I copied this in case they change it or the package goes away. This document describes the componentes of msysgit, which is part of git bash for windows. It explains the difference between MSys and MinGW, and has a link to a very useful wiki ( with instructions on how to report bugs etc. for msysgit/msysgit

Please note!

View gist:14b947e5dbe18caa620dd65bacdc170f
txt <- fread("~/Downloads/iGrill Mini-5839 - Probe - 32418, 112903 AM.csv")
setnames(txt, 'Temperature (°F)', 'temperature')
setnames(txt, 'Date & Time', 'timestamp')
txt[ , timestamp := as.POSIXct(strptime(timestamp, "%m/%d/%y, %I:%M:%S %p"))]
txt[temperature == "--", temperature:=NA]
geneorama / ls.socrata
Last active December 6, 2018 20:01
flattening `ls.socrata`
View ls.socrata

Flatten return values Socrata's data view

You can get the list of data sets in a Socrata domain with the data.json route, for example; "".

However there are some very nested objects that are inconvenient for R. This is just an example of how to flatten specifically the data.json return value from Socrata.

This is not tested. This was a demo in conjunction with work on ls.socrata in the package

geneorama / glmnet_girdsearch.R
Created November 2, 2016 13:34
Heap your criticisms here
View glmnet_girdsearch.R
grid_glmnet <- expand.grid(alpha = c(0, .2, .4, .6, .8, 1),
# lambda = seq(.01, .2, length = 40))
#lambda = rev(exp(seq(log(.00001), log(200), length=10)))
lambda = rev(exp(seq(log(.00001), log(20), length=20))))
results_glmnet <- list()
# g <- unique(dat$grp)[1]
# i <- 1
for(i in 1:nrow(grid_glmnet)){
geneorama / label_encoding_beginning
Last active February 1, 2018 01:13
Example of how to encode data frame with string / factor levels into numeric factor levels, and store the encoding.
View label_encoding_beginning
## gene leynes 2016-10-28
## Label encoder based on
encoding_matrix <- function(df, plug_missing = TRUE, missing_string = "MISSING"){
df <-
cols <- which(sapply(df, is.character) | sapply(df, is.factor))
geneorama / index.html
Last active October 10, 2016 17:22
View index.html
<!DOCTYPE html>
<html xmlns="">
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="pandoc" />