To start godoc at log in time (so it always there on port 6060 when you need it):
- copy smarticus.godoc.plist to in ~/Library/LaunchAgents
launchctl load ~/Library/LaunchAgents/smarticus.godoc.plist
- visit http://localhost:6060
//To be used on shadertoy.com | |
//Uses the image at iChannel0 and warps it into polar coordinates | |
void mainImage( out vec4 fragColor, in vec2 fragCoord ) | |
{ | |
vec2 relativePos = fragCoord.xy - (iResolution.xy / 2.0); | |
vec2 polar; | |
polar.y = sqrt(relativePos.x * relativePos.x + relativePos.y * relativePos.y); | |
polar.y /= iResolution.x / 2.0; | |
polar.y = 1.0 - polar.y; |
To start godoc at log in time (so it always there on port 6060 when you need it):
launchctl load ~/Library/LaunchAgents/smarticus.godoc.plist
import numpy as np | |
import pandas as pd | |
import datetime | |
import urllib | |
from bokeh.plotting import * | |
from bokeh.models import HoverTool | |
from collections import OrderedDict | |
## Read in our data. We've aggregated it by date already, so we don't need to worry about paging |
Copyright (c) 2013 Andrew Brehaut | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in |
If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.
Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.
The simplest way to add an alias for a specific git command is to use a standard bash alias.
# .bashrc
/* | |
MCP4922 test | |
Steve Woodward, 2010 | |
most code borrowed from | |
http://mrbook.org/blog/2008/11/22/controlling-a-gakken-sx-150-synth-with-arduino/ | |
connections | |
==================================================== | |
+5v > 4922 pin 1 |
<!-- | |
* * * * * * * * * * * * * * * * * * * * * * * * * | |
* * | |
* / \ \ / \ * | |
*| | \ | | * | |
*| `. | | : * | |
*` | | \| | * | |
* \ | / / \\\ ____ \\ : * | |
* \ \/ ___~~ ~____| \ | * | |
* \ \__~ ~__\ | * |
import dj_database_url | |
TEST_DATABASES = { | |
'default': dj_database_url.config(env='TEST_DATABASE_URL') | |
} | |
# replace path below to point to HerokuTestSuiteRunner class | |
TEST_RUNNER = 'python.path.to.test_suite_runner.HerokuTestSuiteRunner' |
from collections import namedtuple | |
from math import sqrt | |
import random | |
try: | |
import Image | |
except ImportError: | |
from PIL import Image | |
Point = namedtuple('Point', ('coords', 'n', 'ct')) | |
Cluster = namedtuple('Cluster', ('points', 'center', 'n')) |
This article is now published on my website: Prefer Subshells for Context.