Skip to content

Instantly share code, notes, and snippets.

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

Matt Dray matt-dray

®️
View GitHub Profile
@rxaviers
rxaviers / gist:7360908
Last active May 4, 2024 22:00
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:
@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
@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
@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:

@batpigandme
batpigandme / belchers_listcol.R
Last active March 5, 2023 17:39
Example of using `tidyr::hoist()`.
library(tidyverse)
family <- list(
list(
"name" = "Bob",
"age" = 46,
"mother" = NA,
"father" = "Big Bob",
"siblings" = list(NA),
"children" = list("Tina", "Gene", "Louise"),
@Enchufa2
Enchufa2 / pong.R
Last active July 24, 2022 12:04
Pong in R
# remotes::install_github("coolbutuseless/eventloop")
Pong <- R6::R6Class(
"pong",
public = list(
initialize = function(width=10, height=7, speed=0.02) {
require(grid)
private$width <- width
private$height <- height
@moodymudskipper
moodymudskipper / vassign.R
Last active June 13, 2022 21:54
vassign
makeActiveBinding("v", local({
e <- NULL
count <- 1
function(value) {
# increment or reinitialize counter
exec_env <- sys.frame(-1)
if(identical(e, exec_env)) {
count <<- count + 1
} else {
@emitanaka
emitanaka / collapseoutput.js
Created July 20, 2019 04:43
Collapsible Code Output for `xaringan`
<script>
(function() {
var divHTML = document.querySelectorAll(".details-open");
divHTML.forEach(function (el) {
var preNodes = el.getElementsByTagName("pre");
var outputNode = preNodes[1];
outputNode.outerHTML = "<details open class='output'><summary>Output</summary>" + outputNode.outerHTML + "</details>";
})
})();
(function() {
@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

@mpjdem
mpjdem / game_of_life.R
Last active October 7, 2021 16:08
Conway's game of life in R, visualised in the terminal
library(data.table)
library(keypress)
## Create the universe. Well, sort of.
dims <- c(49, 49)
universe <- CJ(x = seq(dims[1]), y = seq(dims[2]), k = 1, cell = FALSE)
universe[, cell := sample(c(FALSE, TRUE), prod(dims), TRUE)]
## Neighbourhood to consider for each cell
neighbours <- CJ(xd = -1:1, yd = -1:1, k = 1)[xd != 0 | yd != 0]