Skip to content

Instantly share code, notes, and snippets.

View gleitz's full-sized avatar

Benjamin Gleitzman gleitz

View GitHub Profile
@OrionReed
OrionReed / dom3d.js
Last active May 4, 2024 14:07
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@danielgross
danielgross / specific_gpt.py
Created January 23, 2023 15:23
A chat interface that drives GPT-3 towards more specific answers.
"""Stream a response from the OpenAI completion API."""
import os
import re
import sys
import time
import random
import openai
openai.api_key = open(os.path.expanduser("~/.openai")).read().strip()
#!/bin/bash
iatest=$(expr index "$-" i)
#######################################################
# SOURCED ALIAS'S AND SCRIPTS BY zachbrowne.me
#######################################################
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
@nsfmc
nsfmc / .motd.txt
Last active August 29, 2018 18:26
an motd script which reads lines from eno's oblique strategies
Abandon normal instruments [1st ed.]
Accept advice [1st ed.]
Accretion [1st ed.]
A line has two sides [1st ed.]
Allow an easement (an easement is the abandonment of a stricture) [1st ed.]
Are there sections? Consider transitions [1st ed.]
Ask people to work against their better judgement [1st ed.]
Ask your body [1st ed.]
Assemble some of the instruments in a group and treat the group [1st ed.]
Balance the consistency principle with the inconsistency principle [1st ed.]
@perrygeo
perrygeo / TODO
Last active December 31, 2022 21:24
Ansible playbook for a full dev environment
TODO
implement security measures
git config
config files
full sublimetext config
set up openvpn
rdesktop and network drive to terra
set up evolution
RStudio
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@jordanorelli
jordanorelli / monitor.py
Created April 20, 2011 00:30
file change monitor for Django
import os
import sys
import time
import signal
import threading
import atexit
import Queue
_interval = 1.0
_times = {}