Skip to content

Instantly share code, notes, and snippets.

View 2016rshah's full-sized avatar

Rushi Shah 2016rshah

View GitHub Profile
Palette 1:
Teal? Green-ish?:
Main: #2bcabb
Darker border: #047F6F
Blue:
Main: #008ae6
Darker border: #004573
--My initial solution, but I realized that maybe repeatedly calling maximum wasn't good
profits :: [Int] -> [Int]
profits (x:y:ys) = (maximum (xs) - x) : profits (xs)
where xs = y:ys
profits _ = []
--My updated solution that is slightly more complex
--But it keeps track of the current maximum until that current maximum is outdated
profits' :: [Int] -> Int -> [Int]
profits' (x:y:ys) cm =
@2016rshah
2016rshah / OpenCV_for_AI2.md
Last active February 9, 2016 19:01
Instructions on installing OpenCV for AI2 on a mac

(Requirement: homebrew should already be installed) This will install opencv3 on a mac for use with python2

$ brew tap homebrew/science

$ brew install opencv3 --with-python3

$ mkdir -p /Users/rushi/Library/Python/2.7/lib/python/site-packages

submitPush() {
git add .
git commit -m "$1"
git push origin master
cwd=$(pwd)
cd ../
git add .
git commit -m "$1"
@2016rshah
2016rshah / .emacs
Last active November 2, 2017 20:38
(require 'package)
(add-to-list 'package-archives
'("melpa-stable" . "http://stable.melpa.org/packages/") t)
(package-initialize)
;; Stuff for Haskell
(add-hook 'haskell-mode-hook 'turn-on-haskell-indentation)
@2016rshah
2016rshah / cpu-from-class.v
Last active April 4, 2017 23:54
The code we wrote as a class together on the projector today
`timescale 1ps/1ps
module main();
initial begin
$dumpfile("cpu.vcd");
$dumpvars(0,main);
end
// clock
(require 'package)
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(package-archives
(quote
(("gnu" . "http://elpa.gnu.org/packages/")
("melpa-stable" . "http://stable.melpa.org/packages/"))))
#include "stdint.h"
#include "debug.h"
#include "thread.h"
#include "ide.h"
#include "bobfs.h"
void check(const char* name, StrongPtr<Node> f) {
if (f.isNull()) {
Debug::printf("*** 0 %s is null\n",name);
return;
@2016rshah
2016rshah / scraper.py
Last active August 27, 2018 16:10
UT Directory Web Scraper
# Usage:
# python3 script.py input.txt output.txt
# (don't forget to take names out of input.txt when you're done with them)
import sys
import requests
from bs4 import BeautifulSoup
baseURL = 'https://directory.utexas.edu/index.php'
def getEmailFromName(name):
@2016rshah
2016rshah / .bash_profile
Last active June 6, 2018 02:28
Default terminal setup
# Custom prompt
#---------------
# Get the Git branch
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
# Make Git branch a variable
branch=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p')
# Includes custom character for the prompt, path, and Git branch name.