Skip to content

Instantly share code, notes, and snippets.

Ankur Gupta ankur-gupta

Block or report user

Report or block ankur-gupta

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ankur-gupta
ankur-gupta / run-boot-repair.sh
Created Nov 12, 2017
Run boot repair from a Ubuntu Live USB session
View run-boot-repair.sh
#!/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
View rownames-geoR.R
# -----------------------------------------------------------------------------------
# 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 Aug 31, 2015
Demo files for R related blog post: Time is TRUE, Female is FALSE
View correctanswer.R
# 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)
View git-mv-with-history
#!/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.
You can’t perform that action at this time.