curl -sSL -o clone.c goo.gl/G45N5X# on host| defaults write com.apple.Dock appswitcher-all-displays -bool true | |
| killall Dock |
| #!/usr/bin/env bash | |
| # this script gets your latex ready for arxiv submission by | |
| # (1) sanitizing your *.tex of embarrassing comments, | |
| # (2) arxiv-proofing filenames, & | |
| # (3) gzipping everything needed into a convenient .tar.gz | |
| HELPFLAG="-h" | |
| FIGFLAG="-d" | |
| OUTFLAG="-o" |
| echo "buckets logging to a folder other than <theirname>/:" | |
| for bucket in $(aws s3 ls | awk '{print $3}') | |
| do | |
| bucket_status=$(aws s3api get-bucket-logging --bucket $bucket | grep -v "$bucket/") | |
| if [[ $bucket_status != "" ]]; then | |
| echo "\t$bucket" | |
| fi | |
| done | |
| echo "buckets logging to a bucket other than s3.bucket.access.logs:" |
| // ==UserScript== | |
| // @name Show Total Number of Lines Modified in Diff | |
| // @namespace http://tampermonkey.net/ | |
| // @version 0.1 | |
| // @description Show total number of lines modified in diff at bottom of table of contents | |
| // @author lyahdav | |
| // @match UPDATE HERE e.g. https://phab.example.com/D* | |
| // @grant none | |
| // ==/UserScript== |
| # This demonstrates that, when using async/await, a crash in the task will crash the caller | |
| defmodule Tasker do | |
| def good(message) do | |
| IO.puts message | |
| end | |
| def bad(message) do | |
| IO.puts message | |
| raise "I'm BAD!" | |
| end |
A simple Python raytracer that supports spheres with configurable "material" properties (base color and a bunch of
light coefficients). To generate a raytraced image of the pre-defined scene, run: python raytracer.py and open
image.ppm with a PPM-compatible viewer (eog works fine on Linux):
I found the following resources extremely helpful:
| #! /bin/zsh | |
| TIME=$1 | |
| FNAME=$2 | |
| # if [[ $# != 3]] then; | |
| # echo "USAGE: $0 time_interval filename" | |
| # exit 2 | |
| # fi | |
| if [[ -f $FNAME ]]; then |
| // 4 spaces to 2 spaces | |
| %s;^\(\s\+\);\=repeat(' ', len(submatch(0))/2);g | |
| // Tab to 2 spaces | |
| :%s/\t/ /g |