Skip to content

Instantly share code, notes, and snippets.

View patcon's full-sized avatar

Patrick Connolly patcon

View GitHub Profile
@patcon
patcon / 01--README.md
Last active April 17, 2024 18:00
How to display the assigned cluster group ID to a user in the pol.is wrapper app

The browser knows the xid since we generate/assign it in the wrapper app (even if it's just stored in localstorage and never goes to a server).

Using the xid provided in url query param, we can get user details, including the conversation-specific participant ID in .ptpt.pid (see attached for full response)

https://pol.is/api/v3/participationInit?conversation_id=4kjz5rrrfe&pid=mypid&xid=12334552

https://gist.github.com/patcon/d0f8fec0f11c969a5cd9e0ab282f8cb1#file-02-4kjz5rrrfe-participationinit-xid-12334552-json-L23

// snip
@patcon
patcon / closed-pull-request.json
Created April 23, 2014 13:48
Comparing a webhook payload for a closed vs a merged pull request.
{
"action": "closed",
"number": 2302,
"pull_request": {
"url": "https://api.github.com/repos/gittip/www.gittip.com/pulls/2302",
"id": 14945815,
"html_url": "https://github.com/gittip/www.gittip.com/pull/2302",
"diff_url": "https://github.com/gittip/www.gittip.com/pull/2302.diff",
"patch_url": "https://github.com/gittip/www.gittip.com/pull/2302.patch",
"issue_url": "https://api.github.com/repos/gittip/www.gittip.com/issues/2302",
{
"liveblocksType": "LiveObject",
"data": {
"mode": "active",
"clappingHandsReactions": {
"liveblocksType": "LiveList",
"data": [
{
"uid": "92d3c9fd-b9a8-4721-a029-e0fd88e5f0bc",
"at": "1695539736755",
$ docker-compose run --rm maintenance bash setup.sh
Creating gc-digital-talent_maintenance_run ... done
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Package operations: 0 installs, 4 updates, 0 removals
- Downloading monolog/monolog (2.6.0)
- Downloading league/commonmark (2.3.1)
- Downloading laravel/framework (v8.83.12)
- Downloading laravel/sail (v1.14.4)
- Upgrading monolog/monolog (2.5.0 => 2.6.0): Extracting archive
@patcon
patcon / README.md
Last active May 10, 2022 23:24
A parser for the City of Toronto subject thesaurus/taxonomy, helpful for searching tmmis with internal city tags (updated 2021-02-24)

const fs = require('fs');
const ssri = require('ssri');
const path = require('path');
const npmCachePath = process.env.npm_config_cache;
// Get this from npmjs? Not cache?
let integritySha512 = 'sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg=='
let packageName = 'get-caller-file';
let packageVersion = '2.0.5';
@patcon
patcon / 1-terminal.log
Created March 8, 2022 19:13
git bisect to find broken commit
$ git bisect start 2043-lint-fixes f4fcef97cecbefb7a4c1fcfda3f4bcaf553fa88c
# known good: f4fcef97cecbefb7a4c1fcfda3f4bcaf553fa88c
# known bad: 2043-lint-fixes
$ git bisect run bash 1-bisect-test.sh
>>> stdout
[...]
ef5a3f2504e72647af0526a6af093672e65f7a4a is the first bad commit
commit ef5a3f2504e72647af0526a6af093672e65f7a4a
Author: Patrick Connolly <patrick.c.connolly@gmail.com>
Date: Sun Feb 20 23:29:58 2022 -0500
@patcon
patcon / Description.md
Created November 1, 2012 17:54
Using sox CLI tool to gather metrics on ambient volume in room

Running this on OSX, so need to install sox first:

brew install sox

Then paste this file somewhere, and run it in the background with:

bash monitor-audio-levels.sh

As of right now, it only add a character to /tmp/threshold-tally.txt for every 5-second interval where volume exceeds the arbitrary "3" threshold. Would be really useful to timestamp each, and convert to JSON that we can send to a custom leftronic.com dashboard widget, and get a rough idea of how much of the day a room's volume exceeds a given threshold.

Fork the government @ CES

https://www.youtube.com/watch?v=8tc_5bM0zSM&

Transcript from: https://paper.dropbox.com/doc/Fork-the-government-CES--AzmvdRn8ZkN5Zi5~cNWblZPTAg-2WkwonjChbKbl1qMVLGJW

Slides: https://www.slideshare.net/autang/fork-the-government

Host: OK, good afternoon to everybody. My name is Giovanni Allegretti. I am the coordinator of the Centre for Social Studies of the project EMPATIA, enabling multi-channel participation through ICT application. As you can see on the website of the project, we are today hosting at the centre for social studies a working seminar of a colleague who comes from Taiwan, whose name is Audrey Tang.

This file has been truncated, but you can view the full file.
[
{
"statusCode": 200,
"type": "rpc",
"tid": 3,
"ref": false,
"action": "MapPageController",
"method": "remoteSearch",
"result": [
{