Skip to content

Instantly share code, notes, and snippets.

View mnemnion's full-sized avatar

Sam Atman mnemnion

  • Eastern Standard Tribe
View GitHub Profile
@mnemnion
mnemnion / gist:5315689
Created April 5, 2013 00:33
An invocation that gives a solid visual warning when you run under root in Terminal. Add to .profile in ~
export PS1="\u:\W 🔒 "
export SUDO_PS1="\u:\W ‼🔓 ‼ "
@mnemnion
mnemnion / circles.html
Created January 25, 2013 23:58
A little ditty that renders a Chakra 12 board in canvas.
<html>
<head>
<script type="application/javascript">
function draw() {
var canvas = document.getElementById('canvas');
if (canvas.getContext) {
var ctx = canvas.getContext("2d");
var canvasWidth = parseInt(canvas.getAttribute("width"));
var canvasHeight = parseInt(canvas.getAttribute("height"));
var rds = canvasWidth/4;
@mnemnion
mnemnion / gobanrender.asy
Created March 27, 2010 23:31
Asymptote code that renders a Goban
// now a function, also, can draw to any picture not just currentpicture
void drawgoban(picture pic=currentpicture, int gobansize, int gobanlines=19) {
int gobancounter=gobanlines + 1;
unitsize(pic,gobansize/(gobancounter+1));
//Bounding Box and background
filldraw(pic,box((0,0),(gobancounter,gobancounter)),white,white);