Skip to content

Instantly share code, notes, and snippets.

@zyphlar
zyphlar / qgis-getstreetfromaddress.py
Last active September 28, 2023 19:04
QGIS user expression to separate and format streets from addresses (updated for latest Python)
import qgis.core
import qgis.gui
import re
#
# This will keep street names like SR 574A as SR 574A however
# will lowercase other number-digit suffixes with <2 or >4 numbers
# or >1 suffix-letters, like 12th Street or 243rd Ave.
#
@zyphlar
zyphlar / cylon.sh
Created December 9, 2021 19:22
cylon/loop led scanner flasher routine in bash
led0path=/sys/class/leds/$SOME_LED_HERE/brightness
led1path=/sys/class/leds/$SOME_LED_HERE/brightness
led2path=/sys/class/leds/$SOME_LED_HERE/brightness
run=1
led=0
up=1
minled=0
@zyphlar
zyphlar / chimera-bylaws.txt
Created April 23, 2020 23:23
chimera bylaws
Bylaws of
Chimera Art Space
Article 1 - Offices
Section 1. Principal Office
The principal office of the corporation is located in Sonoma County, State of California.
Section 2. Change of Address
The designation of the county or state of the corporation's principal office may be changed by amendment of these bylaws. The board of directors may change the principal office from one location to another within the named county by noting the changed address and effective date below, and such changes of address shall not be deemed, nor require, an amendment of these bylaws:
@zyphlar
zyphlar / dynamic-thermometer.html
Created December 22, 2019 22:49
dynamic fundraising thermometer from google docs / spreadsheet
<!doctype>
<html>
<head>
<script type="text/javascript">
var sheetPublicWebUrl = "https://docs.google.com/spreadsheets/d/e/2PACX-1vSbdn0eDQHBJuC3X8C4Lrmgwsomj5c4K-5x8ROhCkylVNeA5dtCq59wavQcgzmGt8qplXgUBHq-NZEj/pub?gid=0&single=true&range=b1&output=csv"
var req = new XMLHttpRequest();
req.open('GET', sheetPublicWebUrl, true);
req.onload = function() {
result = req.responseText;
@zyphlar
zyphlar / detect_signal.grc
Created May 22, 2019 03:21
Trying to detect when there's a signal on a frequency
<?xml version='1.0' encoding='utf-8'?>
<?grc format='1' created='3.7.11'?>
<flow_graph>
<timestamp>Tue May 21 15:46:50 2019</timestamp>
<block>
<key>options</key>
<param>
<key>author</key>
<value></value>
</param>
@zyphlar
zyphlar / stanford-prison-cites.txt
Last active June 14, 2018 15:20
stanford-prison-cites
Sarah asserts, "I knew there were some sketchy things about the Stanford prison
experiment but whew this piece!"
Dan asserts, "A rare situation where even I don't care about the truth, either
they weren't monsters and we shouldn't say they were, or they were made monsters
and we still shouldn't say they were. Either way, grant them their peace. And we
should still worry about deference to authority."
Sarah asserts, "Not sure you caught the implications — that the basic premise of
the experiment, that there's a monster in all of us, exonerates systems... A
@zyphlar
zyphlar / cloudwatch-alarm-to-slack.js
Last active February 6, 2019 12:00
See comments
'use strict';
/**
* See http://notes.webutvikling.org/send-aws-cloudwatch-alarms-to-slack/ for instructions
* But I like this code better because the snsToSlack.js code doesn't parse the CloudWatch JSON
*
* Follow these steps to configure the webhook in Slack:
*
* 1. Navigate to https://<your-team-domain>.slack.com/services/new
*
twitter
https://twitter.com/MidcourseJam/status/900211595044945920
videobot
https://twitter.com/DSA_Phoenix/status/900205150643658753
videobot
https://twitter.com/Walldo/status/900201042813603841
videobot
@zyphlar
zyphlar / output.txt
Last active December 23, 2016 03:18
Calculating subnet masks with PHP
string(14) "--- Binary ---"
string(44) "Base 11000000101010000000000100001110"
string(44) "Mask 11111111111111111111111000000000"
string(44) "BaseNet 11000000101010000000000000000000"
string(44) "Incrementer 00000000000000000000001000000000"
string(44) "Final 11000000101010000000001000000000"
string(10) "--- IP ---"
string(24) "Base 192.168.1.14"
string(25) "Mask 255.255.254.0"
string(23) "BaseNet 192.168.0.0"
function pairedChartColors(count) {
pairedSchemes = {3:["#a6cee3","#1f78b4","#b2df8a"],4:["#a6cee3","#1f78b4","#b2df8a","#33a02c"],5:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99"],6:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c"],7:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f"],8:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00"],9:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6"],10:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a"],11:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99"],12:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"]}
return pairedSchemes[count];
}