Skip to content

Instantly share code, notes, and snippets.

@jimbrig
jimbrig / gauge_chart_observers.R
Last active June 7, 2020 18:44
Function for Observing a click and changing a tab in a tabsetpanel
#' Gauge Chart Oberserver Function
#'
#' Apply's on.click functionality to change tab when a gauge chart is clicked
#'
#' @param gauge_id id of gauge chart
#' @param tab_to_select tab to move to
#' @param tab_id equals histogram_tab_box for all cases
#' @param session shiny server session
#'
#' @return invisible - used for side effects
@jimbrig
jimbrig / Fill-Values-Within-Groups.R
Last active June 7, 2020 18:43
Fill in values by group where there are missings / NAs
library(dplyr)
df <- data.frame(id = c(1,1,1,2,2,2), value = c(1,NA,NA,NA,NA,777))
df %>%
group_by(id) %>%
mutate(
value2 = first(value[!is.na(value)])
)
# ------------------------------------------------------------------------
#
# Title : Emailing with RDCOMClient Walkthrough Script
# By : Jimmy Briggs <jimmy.briggs@oliverwyman.com>
# Date : 2020-06-03
#
# ------------------------------------------------------------------------
# install RDCOMClient package:
@jimbrig
jimbrig / random_icon.R
Created June 7, 2020 18:42
Generate a random fontawesome icon for quick prototyping. Can also use a "term" to limit random icon choice to a specific category.
library(jsonlite)
library(fontawesome)
library(rlang)
library(purrr)
library(tidyverse)
# https://kapeli.com/cheat_sheets/Font_Awesome.docset/Contents/Resources/Documents/index
# https://github.com/rstudio/fontawesome/blob/master/R/fa.R
url <- "https://raw.githubusercontent.com/FortAwesome/Font-Awesome/master/metadata/icons.json"
@jimbrig
jimbrig / README.md
Created June 7, 2020 18:45 — forked from akashnimare/README.md
A Beginners Guide to writing a Kickass README ✍

Project title

A little info about your project and/ or overview that explains what the project is about.

Motivation

A short description of the motivation behind the creation and maintenance of the project. This should explain why the project exists.

Build status

Build status of continus integration i.e. travis, appveyor etc. Ex. -

Build Status

GTD Mindsweep list

Professional

Projects started, not completed

Projects that need to be started

"Look into . . ." projects

Commitments/promises to others

@jimbrig
jimbrig / git-pushing-multiple.rst
Created June 7, 2020 18:46 — forked from rvl/git-pushing-multiple.rst
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

@jimbrig
jimbrig / get-all-programs.ps1
Created August 14, 2020 06:30
PowerShell: Get List of All Programs
Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate | Format-Table –AutoSize > C:\Users\jimbr\Documents\InstalledPrograms\InstalledPrograms.txt
@jimbrig
jimbrig / RebootWin10-Checklist.md
Last active December 17, 2020 23:34
Windows Setup Pre-Reqs Checklist

-- PRE-INSTALL --

  • Declare Assumptions about your situation
  • Backup your files
  • Sync and save your settings
  • Save a list of your applications and product keys
  • Extract settings from your apps and registry
  • unlink apps / remove PC associations
  • Keep drivers / installation files ready
  • Write down drive letters and Windows product key
  • Safely remove external hard drives from your PC
@jimbrig
jimbrig / helpers.R
Created August 26, 2020 23:30
Shiny Dashboard Collapsible Sidebar
# UI ------------------------------------------------------------
#' import shiny
#' import shinyjs
collapsible_sidebar_ui <- function(width = 230){
tagList(
inlineCSS(paste0(".main-header > .navbar {margin-left: ", width, "px !important}")),
inlineCSS(paste0(".main-header .logo {width: ", width, "px !important}"))