Skip to content

Instantly share code, notes, and snippets.

@amandeepjutla
amandeepjutla / dark_base16-tomorrow-night.rstheme
Last active April 26, 2020 19:29
RStudio theme: dark UI with base16 colors.
/* rs-theme-name: Dark UI Base16 Tomorrow Night */
/* rs-theme-is-dark: TRUE */
/* Dark UI from Randy3k's Wombat (https://github.com/randy3k/dotfiles/blob/master/.R/rstudio/themes/Wombat.rstheme) */
/* "Tomorrow night" color scheme adapted from chriskempson's Base16 (https://github.com/chriskempson/base16). */
.body {
background: #ffffff;
}
@amandeepjutla
amandeepjutla / ocrextract.sh
Created February 1, 2018 00:27
Extract OCRed text from a pdf.
#!/bin/bash
# usage: ocrextract x where x is a pdf file will generate a text file containing x's text
convert -density 300 $1.pdf -depth 8 -alpha OFF $1.tiff
tesseract $1.tiff $1.txt
@amandeepjutla
amandeepjutla / raleigh.py
Last active August 29, 2015 14:19
Automated way to do basic things in an indelicate way. Useful if your needs are limited and you are the only person using a repository; probably worse than useless otherwise.
#!/usr/bin/env python
# raleigh: a stupid git wrapper
import subprocess, sys
try:
if sys.argv[1].lower() == "local":
name = raw_input("Name of commit: ")
subprocess.call("git add .", shell=True)
subprocess.call("git commit -m " + "'" + name + "'", shell=True)
@amandeepjutla
amandeepjutla / vision.py
Last active August 29, 2015 14:19
Simple script that toggles visibility of hidden files in OS X. It requires Python 2.7.
#!/usr/bin/env python
# vision
import subprocess
output = subprocess.check_output(
["defaults", "read", "com.apple.finder", "AppleShowAllFiles"])
if "NO" in output:
subprocess.call(["defaults", "write", "com.apple.finder",
"AppleShowAllFiles", "YES"])