Skip to content

Instantly share code, notes, and snippets.

function helloWorld() {
alert("hello world");
}
cp /code/mjkey.txt /root/.mujoco/mjkey.txt
pip install -r /code/requirements.txt --quiet
pip install -e /code/
softlearning run_example_local examples.development --domain=$1 --task=$2 --algorithm=$3
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
;; This is Ashwin Reddy's custom spacemacs config
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
@ashwinreddy
ashwinreddy / Spotify.lua
Created February 13, 2019 04:19
Hammerspoon configuration to update Mac wallpaper background to the currently playing Spotify track's album artwork
hs.loadSpoon("ReloadConfiguration")
spoon.ReloadConfiguration:start()
function resetImage()
screen = hs.screen.mainScreen()
screen:desktopImageURL("file:///Users/areddy/Pictures/original_8ee2e1707ce7198a75211221f99e6c2d.jpeg")
end
function updateImage()
class HuffmanTree(object):
def __init__(self, left, right):
self.left = left
self.right = right
def encode(self, symbol):
for branch, instruction in ((self.left, "0"), (self.right, "1")):
if type(branch) is HuffmanTree:
if branch.encode(symbol):
import itertools
import numpy as np
class BanzhafPower(object):
def __init__(self, voting_system):
self.voting_system = voting_system
self.generate_coalitions()
self.compute_critical_count()
def generate_coalitions(self):
@ashwinreddy
ashwinreddy / coordinate_systems
Created September 13, 2017 01:43
Coordinate Systems
## Cylindrical
![Imgur](https://i.imgur.com/hMRNeAw.png)
Essentially extends polar to include a $z$-component.
$(r,\theta,z)$
$$
r = x\cos\theta \\\
r = y\sin\theta \\\
z = z
#!/usr/bin/env bash
function disp() {
printf "\033[1;31m";
printf "$1";
printf "\033[0m\n";
}
# Atom installation script
# By Ashwin Reddy
@ashwinreddy
ashwinreddy / spotify-cover.py
Created January 21, 2017 22:02
Retrieves Spotify album image
import urllib2
import urllib
import json
music_type = raw_input("Track or Album? [t/a] ")
if music_type.startswith('t'):
music_type = 0
elif music_type.startswith('a'):
music_type = 1
# TODO: shuffle dataset before gradient descent?
# import random libraries
from random import random, shuffle
# this function scales down from [0,1) to [0,0.16) in order to reduce the amount of "wobble"
def rand():
return random()/6
# main regressor class