Skip to content

Instantly share code, notes, and snippets.

View keybase.md

Keybase proof

I hereby claim:

  • I am egregius313 on github.
  • I am egregius313 (https://keybase.io/egregius313) on keybase.
  • I have a public key ASCL_zbFegLAJnK_yv-stp5WMN5ktXqeDCjWwEPEMkvbSgo

To claim this, I am signing this object:

@egregius313
egregius313 / wallpaper-per-monitor.org
Last active Jun 11, 2019
HOWTO: Set different wallpaper image per-monitor on Windows 10
View wallpaper-per-monitor.org

Howto: Set different wallpaper per monitor

Using Settings

  1. Press Win+R
  2. Specify control /name Microsoft.Personalization /page pageWallpaper and hit enter
  3. Select the images you want. Right-click on each to select the specific monitor(s) you want to use.
@egregius313
egregius313 / git-sync.sh
Created Dec 19, 2018
git-sync Synchronize files across machines via Git
View git-sync.sh
#!/bin/bash
GITSYNC_REPOS=~/.gitsyncrepos
project_root () {
old_dir=$(pwd)
while ! ls .git 1>/dev/null 2>/dev/null
do
cd ..
View super-nand.rkt
#lang eopl
;; Given a quoted logical expression, convert it into nands.
;; Does little to no optimization in terms of output size
(define (super-nand! expr)
(if (and (list? expr) (not (null? expr)))
(case (car expr)
['not (let [[x (super-nand! (cadr expr))]]
(list 'nand x x))]
@egregius313
egregius313 / scheme-help.md
Last active Feb 21, 2018
CS 135 Scheme Cheatsheet
View scheme-help.md
@egregius313
egregius313 / cs392_mac_setup.sh
Created Feb 17, 2018
Script for setting up the proper GCC set up for CS 392 on macOS
View cs392_mac_setup.sh
#!/bin/bash
# Script for setting up the proper GCC set up for CS 392 on macOS
# This script installs GCC version 6
# Check for Homebrew and install it if not present
echo "Checking for brew"
if ! which brew
then
echo "Installing Homebrew"
@egregius313
egregius313 / check_cflags.py
Created Feb 16, 2018
check_cflags - guarantees that -Wall -Werror --pedantic flags are set in $CFLAGS
View check_cflags.py
#!/usr/bin/env python
# check_cflags.py
"""
check_cflags - guarantees that -Wall -Werror --pedantic flags are set in $CFLAGS
Exits with 0 if proper CFLAGS is used, otherwise returns with 1
Usage:
./check_cflags.py FILE
"""
@egregius313
egregius313 / mac_bootstrap_gcc.sh
Created Feb 8, 2018
Script for bootstrapping gcc and g++ (4.9) on Mac OSX
View mac_bootstrap_gcc.sh
#!/bin/bash
which brew || /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install gcc@4.9
echo "alias gcc='gcc-4.9'" >> .bash_profile
echo "alias g++='g++-4.9'" >> .bash_profile
@egregius313
egregius313 / ocaml_bootstrap.sh
Created Jan 17, 2018
Bootstrap an OCaml Installation on a Debian or OSX system
View ocaml_bootstrap.sh
PKG_MGR=$(which apt-get brew apt | head -n1)
sudo $PKG_MGR update
sudo $PKG_MGR install -y opam
opam update
opam install core
if [[ $PKG_MGR =~ apt ]]
then
@egregius313
egregius313 / unpackable.py
Created Dec 23, 2017
Allow tuple unpacking on classes defined with @attr.s
View unpackable.py
# Allow tuple unpacking on classes defined with
# @attr.s decorator. Uses the attribute information
# from the definition of the class using attrs
#
# See also:
# http://www.attrs.org
# https://github.com/python-attrs/attrs
import hashlib
import linecache
You can’t perform that action at this time.