Skip to content

Instantly share code, notes, and snippets.

Using deno, git, virtualenv plugins

lyttle.zsh-theme:

PROMPT='%{$fg_bold[cyan]%}$(virtualenv_prompt_info)%}$(git_prompt_info) %c %{$fg_bold[white]%}%% %{$reset_color%}'

ZSH_THEME_GIT_PROMPT_PREFIX="("
ZSH_THEME_GIT_PROMPT_SUFFIX=")"
ZSH_THEME_GIT_PROMPT_DIRTY=""
@ijlyttle
ijlyttle / deno.md
Created December 10, 2022 21:29
Deno configuration

This is macOS-centric.

Installation

brew install deno

Configuration

@ijlyttle
ijlyttle / app.R
Last active October 5, 2022 23:12
# Example of vegawidget with dynamic data and signal
#
# To use shiny_get_signal along with dynamic data (on R side), you have to use
# shiny_set_data as well. This is because the binding of shiny_get_signal breaks
# if you use normal reactive data (see other file in this folder).
#
# shiny_set_data work saround that problem and uses an elegant reactive solution
#
# based on: https://github.com/rhenkin/rsnippets/blob/main/vegawidget_shinygetsignal/app_working.R
#
@ijlyttle
ijlyttle / LICENSE.md
Last active February 5, 2022 18:51
Generating JSON for CVD matrices

MIT License

Copyright (c) 2022 Ian Lyttle

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:

@ijlyttle
ijlyttle / install_RMySQL.md
Last active February 5, 2022 10:04
how to install RMySQL

Keep in mind this page (http://biostat.mc.vanderbilt.edu/wiki/Main/RMySQL)

Windows 7

Install MySQL Community Server from (http://dev.mysql.com/downloads/mysql/)

Then (from StackOverflow)

  • Go to System->Advanced->Enviroment Variables, press New and Enter Variable name as MYSQL_HOME and Variable values as C:/PROGRA~1/MYSQL/MYSQLS~1.6, and notice that it is / not \. This is a bit different from the StackOverflow answer - the trick is to use the Windows shortname. Open a command window, go to your MySQL directory, and type dir /x to get the correct particular ending. From R, confirm by typing Sys.getenv("MYSQL_HOME").
@ijlyttle
ijlyttle / altair.Rmd
Created January 23, 2020 17:15
Altair + reticulate + vegawidget
---
title: "Altair-reticulate"
output: html_document
---
```{r load_packages}
library(vegawidget)
library(reticulate)
```
@ijlyttle
ijlyttle / server.R
Last active December 14, 2020 14:20
demonstration of attempt to get `conditionalPanel` to work on a file-upload condition
library(shiny)
shinyServer(function(input, output) {
# Has a file been imported?
output$csv_import_ready <- reactive({
return(!is.null(input$csv_import_file))
})
# SOLUTION (2013-08-17)
@ijlyttle
ijlyttle / manifesto.md
Last active September 28, 2020 13:31
github flow manifesto

These ideas based on GitHub Flow and are heavily influenced by Jenny Bryan and Hadley Wickham, through their R package {usethis}.

Remotes

The term upstream refers to a remote that is the "canonical" repository for a project.

The term origin refers to a remote that is a fork of an upstream remote.

If you are one of the maintainers for a repository, you can push to the upstream remote.

@ijlyttle
ijlyttle / .block
Created August 22, 2018 18:43
Vega-Lite: multiple data
license: mit
height: 500
scrolling: yes
border: yes
@ijlyttle
ijlyttle / woodiac.R
Last active December 21, 2019 02:17
An alternative calendar
# imports lubridate, emo, glue, purrr
as_woodiac <- function(x) {
is_dst <- lubridate::dst(as.POSIXct(x)) # pick up OS timzone
x <- lubridate::as_date(x)
date_2000 <- x
lubridate::year(date_2000) <- 2000