Skip to content

Instantly share code, notes, and snippets.

View matt-dray's full-sized avatar
®️

Matt Dray matt-dray

®️
View GitHub Profile
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@rxaviers
rxaviers / gist:7360908
Last active April 26, 2024 15:35
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@Quiri
Quiri / server.R
Created September 9, 2014 10:05
Shiny disable checkbox minimal example
library(shiny)
shinyServer(function(input, output, session) {
observe({
if(input$tv == "All, but C") {
updateCheckboxGroupInput(session, "check2", label = NULL, choices = NULL,
selected = c("A", "B", "D", "E"))
}
if(input$tv == "Only C or D") {
@primaryobjects
primaryobjects / markov.R
Last active March 31, 2020 04:21
Generating text with a markov chain in R.
library(markovchain)
text <- readLines('text.txt')
text <- text[nchar(text) > 0]
text <- gsub('.', ' .', text, fixed = TRUE)
text <- gsub(',', ' ,', text, fixed = TRUE)
text <- gsub('!', ' !', text, fixed = TRUE)
text <- gsub('(', '( ', text, fixed = TRUE)
text <- gsub(')', ' )', text, fixed = TRUE)
@ivyleavedtoadflax
ivyleavedtoadflax / R_connect_to_MS_SQL_Server.md
Last active December 22, 2021 00:46
R Connect to MS SQL Server

Connecting to MS SQL Server using RODBC

You may need to install the following libraries (if you don't already have them)

install.packages("RODBC")
install.packages("dplyr")

Load these packages

@ctesta01
ctesta01 / qsf_explanation.md
Last active April 4, 2024 07:44
How does a Qualtrics Survey File work?

Quickstart Guide to undertsanding the Qualtrics Survey File

This information is likely to quickly become outdated when Qualtrics next changes the formatting of the QSF file. This guide was started February 2017. I hope that it is a useful introduction to understanding the contents of the QSF file that one can download from Qualtrics.

This document includes:

@niw
niw / fetch_nike_puls_all_activities.bash
Last active April 10, 2024 08:48
A simple NikePlus API description to fetch past run metrics
#!/usr/bin/env bash
# fetch_nike_puls_all_activities.bash
# A simple bash script to fetch all activities and metrics from NikePlus.
# See `nike_plus_api.md` for the API details.
readonly bearer_token="$1"
if [[ -z "$bearer_token" ]]; then
echo "Usage: $0 bearer_token"
exit
library(tidyverse)
files <- list.files("../open-data/", pattern = "^2017", full.names = TRUE)
full <- map_df(files, read_csv)
dplyr::glimpse(full)
# With names
files <- list.files("../open-data/", pattern = "^2017", full.names = TRUE) %>%
set_names(basename(.))
full <- map_df(files, read_csv, .id = "file")
@dublado
dublado / estimate read time calc hugo.md
Last active June 29, 2021 15:20
estimate read time calc hugo
<i>{{.ReadingTime}}{{if gt (mul .ReadingTime 60) 60}}minutes{{else}}minutes or less{{end}} reading</i>

formula
(add .WordCount 212) 213

.ReadingTime

@padpadpadpad
padpadpadpad / label_facets_ggplot2.R
Last active March 28, 2019 07:49
function to label facets with letters in ggplot2
# load package
library(ggplot2)
# write function
label_facets <- function(string){
len <- length(string)
string = paste('(', letters[1:len], ') ', string, sep = '')
return(string)
}