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
{
"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
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
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": [
{
@patcon
patcon / StaticXFA2AcroForm.java
Created October 16, 2020 00:42 — forked from JoelGeraci-Datalogics/StaticXFA2AcroForm.java
This Gist will convert a Static XFA Form to an AcroForm by removing the XFA dictionary.
/*
* Copyright Datalogics, Inc. 2015
*/
package pdfjt.cookbook.forms;
import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;
@patcon
patcon / script.sh
Last active June 17, 2020 19:57
Small script to find any strings in js/strings/en.js that are not used in client-participation codebase.
cd client-participation/js/strings/
cat en.js \
| grep '^ ' \
| cut -d '"' -f2 \
| xargs -E $'\n' sh -c 'for arg do echo "$arg"; git grep "s\.$arg" ../../ \
| cat; done' > used-strings.log
diff --git a/server/package-lock.json b/server/package-lock.json
index f3d300fa..c4b26bb5 100644
--- a/server/package-lock.json
+++ b/server/package-lock.json
@@ -224,6 +224,11 @@
}
}
},
+ "abbrev": {
+ "version": "1.1.1",
@patcon
patcon / polis-convo-table-entry.diff
Last active June 5, 2020 17:12
Changes when toggling all boxes on polis convo
--- /tmp/polis-convo01.out 2020-06-05 14:09:11.000000000 -0300
+++ /tmp/polis-convo02.out 2020-06-05 14:08:53.000000000 -0300
@@ -20,15 +20,15 @@
is_data_open | f
profanity_filter | t
spam_filter | t
-strict_moderation | f
+strict_moderation | t
prioritize_seed | f
-vis_type | 0