Skip to content

Instantly share code, notes, and snippets.

View ankur-gupta's full-sized avatar

Ankur Gupta ankur-gupta

View GitHub Profile

Keybase proof

I hereby claim:

  • I am ankur-gupta on github.
  • I am ankurgupta (https://keybase.io/ankurgupta) on keybase.
  • I have a public key ASBAt37WOcyDY-KQNj2AOgjhL-ZVkspmqHa8aIOwUrfnUQo

To claim this, I am signing this object:

@ankur-gupta
ankur-gupta / run-boot-repair.sh
Created November 12, 2017 02:49
Run boot repair from a Ubuntu Live USB session
#!/bin/sh
# From https://help.ubuntu.com/community/Boot-Repair
sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt-get update
sudo apt-get install -y boot-repair && boot-repair
# -----------------------------------------------------------------------------------
# Demo of a function that depends upon matrix rownames
# -----------------------------------------------------------------------------------
rm(list = ls())
graphics.off()
library(geoR) # Tested with geoR_1.7-5.1
# Extract a small matrix for demonstration
@ankur-gupta
ankur-gupta / correctanswer.R
Last active August 31, 2015 09:58
Demo files for R related blog post: Time is TRUE, Female is FALSE
# correctanswer.R: sourcing this file in a fresh R session gives the correct answer = 5.
source("oddmean.R")
y <- 1:10
correct.answer <- oddmean(y)
print(correct.answer)
#!/bin/bash
#
# git-mv-with-history -- move/rename file or folder, with history.
#
# Moving a file in git doesn't track history, so the purpose of this
# utility is best explained from the kernel wiki:
#
# Git has a rename command git mv, but that is just for convenience.
# The effect is indistinguishable from removing the file and adding another
# with different name and the same content.