Skip to content

Instantly share code, notes, and snippets.

View patcon's full-sized avatar

Patrick Connolly patcon

View GitHub Profile
@patcon
patcon / gmail.rc
Created March 7, 2025 19:34 — forked from flatcap/gmail.rc
neomutt config gmail
# To use: change gmail's settings to:
# enable imap:
# Gmail Settings
# Forwarding and POP/IMAP
# create an app password
# App passwords
# https://myaccount.google.com/security
set imap_login = ""
set imap_pass = "XXXXXXXXXXXXXXXX"
from tabpfn_extensions import interpretability
from tabpfn import TabPFNClassifier
import numpy as np
# Initialize and load data
client = PolisClient()
client.load_data(report_id="r8xhmkwp6shm9yfermteh")
# Generate and process the vote matrix
vote_matrix = client.get_matrix(is_filtered=True)
@patcon
patcon / duplicate-vote-from-csv-export.ipynb
Last active February 15, 2025 01:11
duplicate-vote-from-csv-export.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@patcon
patcon / get-polis-convo-deets.sh
Last active February 20, 2025 19:05
A small script to quickly get details on a Polis conversation ID.
#!/usr/bin/env bash
# Uncomment this to use report-id instead of conversation-id.
#REPORT_ID=$1
#REPORT_DATA=$(curl --silent --user-agent "x" "https://pol.is/api/v3/reports?report_id=$REPORT_ID")
#CONVO_ID=$(jq -r '.[0].conversation_id' <<< "$REPORT_DATA")
# Usage: sh get-polis-convo-deets.sh [https://polis.example.com/]<conversation-id>
@patcon
patcon / comments.json
Created January 9, 2025 20:48
API data from https://pol.is/4yy3sh84js Polis conversation
[
{
"txt": "NZ needs a new system that better guarantees the welfare of the least well off and those facing insecure work conditions.",
"tid": 0,
"created": "1502652450312",
"tweet_id": null,
"quote_src_url": null,
"is_seed": true,
"is_meta": false,
"lang": "en",
@patcon
patcon / README.md
Last active November 5, 2024 23:52

GitHub org pages don't redirect, but github repos do. So can try commonly forked github repos likely to appear in any brigade org.

Ran this to:

  1. get the list of
  2. find the "projects_list_url" values that aren't null, empty
  3. filter for only github.com urls (e.g., https://github.com/code-for-tp)
  4. take only the end of path (e.g., code-for-tp
  5. curl GitHub API for a codeofconduct repo forked from code-for-america (e.g., code-for-tp/codeofconduct)
  6. [leaky level] if redirect, get redirect url

To the Clerk's Office --

I've been fairly involved in attending committee sessions in the past, but have some questions about what's possible for visual aids when giving a deputation.

As context: As part of a small community group, I'm hoping to present some results from an outreach exercise at a future committee session on a relevant agenda item. Results will be coming in after 4:30pm submission deadline, likely right up until the hour of deputation, and so I'm trying to figure out how to accommodate that live data in the visuals.

Is it possible to show presentation slides on the projector screen as I speak? Would a Google Slide link be acceptable, and would that be displayed in its standard web format, not exported? (Specifically, I'm wondering if I can update an image on a slide.) Alternatively, is it possible to show a website on the projector screen? If so, would I be able to navigate that website myself while speaking? Are document cameras available for showing printed material on-screen? If so, coul

@patcon
patcon / crowdwisdom--8wmbcdmfdr--math-pca2.json
Created May 28, 2024 13:23
Response from /math/pca2/ endpoint for Plural Research Experiment
{
"n": 41,
"pca": {
"comps": [
[0, 0, 0, 0, 0, 0, 0.0982148134063051, -0.0395807796201572, 0.0255458342902308, 0.0895542461578575, 0.0622362593020714, 0.0619847040322527, 0.0691659447132596, 0.132839572974422, 0.199116266094196, 0.0877755063873693, 0.141321085541321, 0.0887043117571917, 0.0259982179280277, 0.0373454637465944, 0, -0.025292261486439, 0.00390422243208681, 0.119963903854036, 0.12183511443554, 0.0509043107490715, 0.16281524349036, 0.0351953221274216, 0.177136920144061, 0.126486569445845, 0.129170606878865, -0.0276735756465717, 0.0345244656915796, -0.00144753935700808, 0.0684443120602143, 0.0602725121802336, 0.104940656909645, 0.0724048053635653, 0.0629474871408984, 0.188782282222489, -0.0185361114541214, 0.0745405648144721, 0.13705733251262, 0.0587340591007566, 0.0592251108993003, -0.00925521718545387, 0.0659799958311654, 0.192416249592286, 0.00856904080215316, 0.187016573782286, 0.0208855127296274, 0.133429980427884, -0.0456214094636508, 0.021289825295605, 0.0189938244404089, 0.2339
@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
{
"liveblocksType": "LiveObject",
"data": {
"mode": "active",
"clappingHandsReactions": {
"liveblocksType": "LiveList",
"data": [
{
"uid": "92d3c9fd-b9a8-4721-a029-e0fd88e5f0bc",
"at": "1695539736755",