Skip to content

Instantly share code, notes, and snippets.

Avatar

Patrick Connolly patcon

View GitHub Profile
View 2020-12-07-little-free-libraries-canada.json
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 Oct 16, 2020 — forked from JoelGeraci-Datalogics/StaticXFA2AcroForm.java
This Gist will convert a Static XFA Form to an AcroForm by removing the XFA dictionary.
View StaticXFA2AcroForm.java
/*
* 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 Jun 17, 2020
Small script to find any strings in js/strings/en.js that are not used in client-participation codebase.
View script.sh
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
View bcrypt-upgrade.diff
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 Jun 5, 2020
Changes when toggling all boxes on polis convo
View polis-convo-table-entry.diff
--- /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
@patcon
patcon / embed.diff
Created May 19, 2020
diff client-participation/api/embed.js client-participation/api/embedPreprod.js
View embed.diff
6c6
< var polisUrl = "https://pol.is";
---
> var polisUrl = "https://preprod.pol.is";
101a102
>
234,236c235,237
< if (data === "cookieRedirect" && cookiesEnabledAtTopLevel()) {// // temporarily redirect to polis, which will set a cookie and redirect back
< window.location = polisUrl + "/api/v3/launchPrep?dest=" + encodeReturnUrl(window.location+"");
< }
@patcon
patcon / code.gs
Created Dec 10, 2019
Google Script for generating leadership status checkins. See https://github.com/CivicTechTO/civictechto-scripts/issues/2
View code.gs
/**
* Source: http://mashe.hawksey.info/2014/07/google-sheets-as-a-database-insert-with-apps-script-using-postget-methods-with-ajax-example/
*
* Usage
* 1. Publish > Deploy as web app
* - enter Project Version name and click 'Save New Version'
* - set security level and enable service (most likely execute as 'me' and access 'anyone, even anonymously')
*
* 2. Copy the 'Current web app URL'.
*
@patcon
patcon / code.gs
Created Dec 10, 2019
Google Script for generating leadership status checkins. See https://github.com/CivicTechTO/civictechto-scripts/issues/2
View code.gs
/**
* Source: http://mashe.hawksey.info/2014/07/google-sheets-as-a-database-insert-with-apps-script-using-postget-methods-with-ajax-example/
*
* Usage
* 1. Publish > Deploy as web app
* - enter Project Version name and click 'Save New Version'
* - set security level and enable service (most likely execute as 'me' and access 'anyone, even anonymously')
*
* 2. Copy the 'Current web app URL'.
*
@patcon
patcon / code.gs
Created Dec 10, 2019
Google Script for generating leadership status checkins. See https://github.com/CivicTechTO/civictechto-scripts/issues/2
View code.gs
/**
* Source: http://mashe.hawksey.info/2014/07/google-sheets-as-a-database-insert-with-apps-script-using-postget-methods-with-ajax-example/
*
* Usage
* 1. Publish > Deploy as web app
* - enter Project Version name and click 'Save New Version'
* - set security level and enable service (most likely execute as 'me' and access 'anyone, even anonymously')
*
* 2. Copy the 'Current web app URL'.
*
@patcon
patcon / code.gs
Created Dec 10, 2019
Google Script for generating leadership status checkins. See https://github.com/CivicTechTO/civictechto-scripts/issues/2
View code.gs
/**
* Source: http://mashe.hawksey.info/2014/07/google-sheets-as-a-database-insert-with-apps-script-using-postget-methods-with-ajax-example/
*
* Usage
* 1. Publish > Deploy as web app
* - enter Project Version name and click 'Save New Version'
* - set security level and enable service (most likely execute as 'me' and access 'anyone, even anonymously')
*
* 2. Copy the 'Current web app URL'.
*