Skip to content

Instantly share code, notes, and snippets.

View joshuaulrich's full-sized avatar

Joshua Ulrich joshuaulrich

View GitHub Profile
@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
#!/usr/bin/awk -f
# This program is a copy of guff, a plot device. https://github.com/silentbicycle/guff
# My copy here is written in awk instead of C, has no compelling benefit.
# Public domain. @thingskatedid
# Run as awk -v x=xyz ... or env variables for stuff?
# Assumptions: the data is evenly spaced along the x-axis
# TODO: moving average
@aortbals
aortbals / squash-and-merge-cli.md
Last active January 16, 2024 10:46
Squash and Merge on the Command line

With the introduction of GitHub's Squash and Merge feature, this has become less prevelant, however it's still useful in scenarios where GitHub's interface is unavailable.

Let's talk through two ways to do a squash and merge on the command line.

Take 1: Interactive Rebase

When to use it

  • When you have not merged main into your feature branch
  • There are no merge conflicts
@halpo
halpo / Makefile
Created November 17, 2011 20:07
Makefile for R Packages
# Makefile for generating R packages.
# 2011 Andrew Redd
#
# Assumes Makefile is in a folder where package contents are in a subfolder pkg.
# Roxygen uses the roxygen2 package, and will run automatically on check and all.
PKG_VERSION=$(shell grep -i ^version pkg/DESCRIPTION | cut -d : -d \ -f 2)
PKG_NAME=$(shell grep -i ^package pkg/DESCRIPTION | cut -d : -d \ -f 2)
R_FILES := $(wildcard pkg/R/*.R)
@flare9x
flare9x / R Simple Back Test Script - 30min ES.R
Last active April 11, 2018 19:51
R Simple Back Test Script - 30min ES
# Back test simple moving average strategy
# Use 30min ES Data
require(TTR)
require(quantmod)
require(lubridate)
require(dplyr)
require(microbenchmark)
i=1
out_results <- data.frame()
@romainfrancois
romainfrancois / output.txt
Created December 14, 2013 14:07
Extract promises and their environments from ...
> f <- function(...) {
+ promises(environment())
+ }
> g <- function(x = 3, ...) {
+ z <- 4
+ f(z = z, ..., x = x)
+ }
> h <- function(..., a = 2) {