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 start godoc at log in time (so it always there on port 6060 when you need it):
launchctl load ~/Library/LaunchAgents/smarticus.godoc.plist
"""Utility for pulling settings from the environment.""" | |
import os | |
from urllib.parse import urlparse | |
class EnvParser: | |
"""Utility for getting settings from the OS environ. | |
Instantiate with the name of an env var to get the current mode from (that | |
env var should be set to one of VALID_MODES, or not set), then call the |
/** | |
* This is based on: http://docs.aws.amazon.com/lambda/latest/dg/walkthrough-s3-events-adminuser.html | |
*/ | |
// dependencies | |
var async = require('async'); | |
var AWS = require('aws-sdk'); | |
var gm = require('gm').subClass({ imageMagick: true }); // Enable ImageMagick integration. | |
var util = require('util'); | |
var MAX_WIDTH; |
//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; |
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' |
Prerequisite | |
JQ: brew install jq | |
Chrome/Safari Inspector | |
Log in and open https://venmo.com/#yours | |
Open Chrome/Safari Inspector | |
Go to Network Tab and filter for 'feed' | |
Right click and Save "feed" as "venmo_feed.json" | |
Run in Terminal: | |
cat venmo_feed.json | jq '.data[] | {actor: .actor.name, target: .transactions[0].target.name, type: .type, message: .message, date: .created_time, amount: .transactions[0].amount}' | jq -s -r '(map(keys) | add | unique) as $cols | map(. as $row | $cols | map($row[.])) as $rows | $cols, $rows[] | @csv' > venmo_feed.csv |
/* | |
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 |
-- Window Function examples | |
-- PostgreSQL conference South Africa 2018 | |
-- By Willem Booysen | |
-- Youtube: https://www.youtube.com/watch?v=blHEnrYwySE | |
-- Create database and templates for demo | |
DROP DATABASE IF EXISTS WindowFunctions; | |
CREATE DATABASE WindowFunctions; |
import os | |
from django.test.runner import DiscoverRunner | |
""" | |
WARNING: WHEN USED INCORRECTLY THIS TEST RUNNER WILL DROP ALL TABLES IN YOUR PRODUCTION | |
DATABASE!!! | |
Heroku does not give users createdb/dropdb permissions, therefore Heroku CI cannot run tests for django. | |
In order to fix this, use this test runner instead which attempts to minimally override the |
This article is now published on my website: Prefer Subshells for Context.