Skip to content

Instantly share code, notes, and snippets.

@isaacl
isaacl / gradescope_expander.js
Last active October 16, 2022 15:22
Gradescope userscript: Expand programming assignments
// ==UserScript==
// @name Gradescope assignment expander
// @namespace https://gist.github.com/isaacl/86d5121ede0eeac3eb6a4016555ad70e
// @version 0.1.8
// @description Expands programming exercises with keyboard
// @author Isaac Levy
// @match *://*.gradescope.com/*
// @grant none
// @license MIT
// ==/UserScript==
#!/usr/bin/env python3
import iterm2
import AppKit
import asyncio
# Each command runs in its own tab.
commands = [
"echo 1",
"echo 2"
@isaacl
isaacl / .gitignore
Last active May 9, 2017 13:56
BitCount
*.class
{
"type" : "record",
"name" : "ParsedPixAllHit",
"namespace" : "com.dealer.analytics.pixall.processing",
"fields" : [ {
"name" : "visitorId",
"type" : "string"
}, {
"name" : "hitUuid",
"type" : {
@isaacl
isaacl / -
Created March 29, 2016 17:47
{
"extends": "airbnb",
"rules": {
"comma-dangle": 0,
"react/no-multi-comp": [1, { "ignoreStateless": true }],
"id-length": 0,
"indent": [1, 4, {"SwitchCase": 1}],
"max-len": 0,
"no-nested-ternary": 0,
"object-curly-spacing": 0,
#!/bin/bash -e
# option parsing.
FAST_ESLINT=0
ALLOW_WARNINGS=0
ESLINT_VERBOSE=0
OPTIND=1 # Reset in case getopts has been used previously in the shell.
while getopts ":fvw" opt; do
case "$opt" in
v) ESLINT_VERBOSE=1
@isaacl
isaacl / lint.py
Last active March 29, 2016 20:03
#!/usr/bin/env python
import argparse
import os
import pipes
import subprocess
import sys
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__));
os.chdir(subprocess.check_output(['git', 'rev-parse', '--show-toplevel'],
# bitwise python solution to n queens with some pretty printing
# described by Martin Richards in http://www.cl.cam.ac.uk/~mr10/backtrk.pdf
import sys
import shutil
import itertools
def tryP(ld, col, rd, all_p, cur_s):
if (col == all_p):
return (cur_s,)
@isaacl
isaacl / wh
Created November 16, 2014 00:55
A better version of 'which' which understands builtins and follows symlinks
#!/bin/bash -e
com="$1"
if [[ -z "$com" ]]; then
exit 1
fi
while true; do
case $(type -t "$com") in
@isaacl
isaacl / script.js
Created October 17, 2014 07:25
Userscript: Stop websites from hijacking keyboard shortcuts.
// ==UserScript==
// @name Disable website keyboard hooks
// @description Stop websites from hijacking keyboard shortcuts.
// @author Isaac Levy
// @run-at document-start
// @include *
// @grant none
// @version 0.0.1
// @namespace https://isaacrlevy.com
// ==/UserScript==