Skip to content

Instantly share code, notes, and snippets.

View patcon's full-sized avatar

Patrick Connolly patcon

View GitHub Profile
@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
@patcon
patcon / embed.diff
Created May 19, 2020 16:17
diff client-participation/api/embed.js client-participation/api/embedPreprod.js
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 December 10, 2019 19:57
Google Script for generating leadership status checkins. See https://github.com/CivicTechTO/civictechto-scripts/issues/2
/**
* 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 December 10, 2019 19:56
Google Script for generating leadership status checkins. See https://github.com/CivicTechTO/civictechto-scripts/issues/2
/**
* 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 December 10, 2019 19:56
Google Script for generating leadership status checkins. See https://github.com/CivicTechTO/civictechto-scripts/issues/2
/**
* 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 December 10, 2019 19:56
Google Script for generating leadership status checkins. See https://github.com/CivicTechTO/civictechto-scripts/issues/2
/**
* 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 December 10, 2019 19:56
Google Script for generating leadership status checkins. See https://github.com/CivicTechTO/civictechto-scripts/issues/2
/**
* 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'.
*