Skip to content

Instantly share code, notes, and snippets.

zyphlar / generatePassword.php
Created December 20, 2014 22:36
Generating secure passwords in PHP
View generatePassword.php
// usage: $newpassword = generatePassword(12); // for a 12-char password, upper/lower/numbers.
// functions that use rand() or mt_rand() are not secure according to the PHP manual.
function getRandomBytes($nbBytes = 32)
$bytes = openssl_random_pseudo_bytes($nbBytes, $strong);
if (false !== $bytes && true === $strong) {
return $bytes;
zyphlar /
Created August 31, 2022 23:45
QGIS user expression to separate and format streets from addresses
from qgis.core import *
from qgis.gui import *
@qgsfunction(args='auto', group='Custom', referenced_columns=[])
def getstreetfromaddress(value1, feature, parent):
parts = value1.split()
parts.pop(0) # Ignore the first bit (i.e. "123" in "123 N MAIN ST")
parts = map(formatstreetname, parts)
return " ".join(parts)
View controller.php
function editAction(){
$form = $this->createForm(new Forms\UserType($userConfig), $user);
if($form->isValid()) {
$em = $this->getDoctrine()->getManager();
zyphlar /
Created December 9, 2021 19:22
cylon/loop led scanner flasher routine in bash
zyphlar / gist:b980f22b9b2c47935628
Last active December 9, 2021 17:46
Talking about makerspace management and hackerspaces
View gist:b980f22b9b2c47935628
11:31 AM <LesaraRose> Sorry. I have a lot of questions lol
11:33 AM <TheWill> hardest: inspiring volunteers. work: being everybody's surrogate parent because they were ~20yo and antisocial and didn't know how to avoid generating a storm of drama everywhere they go
11:34 AM <TheWill> the idea of "everybody contributes towards the common good" is great until you're dealing with people who can't resolve the "who washes the dishes" conflict with their roommate
11:35 AM <TheWill> in other words a balance of demographics is vastly superior even if less comfortable
11:36 AM <TheWill> having a paid community manager is in my opinion the most effective way to reduce drama
11:36 AM <TheWill> and burnout
11:40 AM <myself> Hardest: Getting our external image to reflect the diversity of stuff actually happening in the space. Our technical people get more attention than our artistic people, so it takes a lot of work to bring in more artistic people. Yet, when we take both technical and artistic projects to show off at an e
zyphlar / chimera-bylaws.txt
Created April 23, 2020 23:23
chimera bylaws
View chimera-bylaws.txt
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 / asterisk-logfile-analyzer.php
Created June 26, 2012 10:19
Cheap and Dirty Asterisk Logfile Analysis
View asterisk-logfile-analyzer.php
/* Cheap and Dirty Asterisk Logfile Analysis
* by Will Bradley,
* Released to the public domain, 6-26-2012
* To install, modify the $dbname and other variables,
* create the MySQL database, user, and permissions,
* and double-check the asterisk logfile paths/formats below.
* This is a very cheap script, use at your own risk!
zyphlar / rgb-hsv-conversion.php
Created October 21, 2014 22:22
RGB and HSV conversion in PHP
View rgb-hsv-conversion.php
// note: some of these are written with $this so they work inside classes.
// you could easily rewrite this to be a general function outside a class.
// sorry for the inconsistent tabs
// adapted from: via
class MyClass
// usage: $this->hexColorMod("#aa00ff", -0.2); // darker by 20%
// returns: #8700cc
zyphlar / dynamic-thermometer.html
Created December 22, 2019 22:49
dynamic fundraising thermometer from google docs / spreadsheet
View dynamic-thermometer.html
<script type="text/javascript">
var sheetPublicWebUrl = ""
var req = new XMLHttpRequest();'GET', sheetPublicWebUrl, true);
req.onload = function() {
result = req.responseText;
zyphlar / detect_signal.grc
Created May 22, 2019 03:21
Trying to detect when there's a signal on a frequency
View detect_signal.grc
<?xml version='1.0' encoding='utf-8'?>
<?grc format='1' created='3.7.11'?>
<timestamp>Tue May 21 15:46:50 2019</timestamp>