Skip to content

Instantly share code, notes, and snippets.

View mrchrisadams's full-sized avatar

Chris Adams mrchrisadams

View GitHub Profile
@mrchrisadams
mrchrisadams / core.clj
Last active April 3, 2020 08:36
I'm trying to learn to use clojure to parse a wordpress XML and generate markdown files for each one.
; add a basic namespace, I guess
(ns thingo.core)
(require '[clojure.java.io :as io])
(require '[clojure.xml :as xml])
(require '[clojure.zip :as zip])
(require '[clojure.data.zip.xml :as zip-xml])
(require '[clojure.pprint :refer pprint :as pp])
(def blog-file "./path-to-wordpress-export-file.xml")
@mrchrisadams
mrchrisadams / traceback-hint-overloaded-method-toArray.txt
Created March 21, 2020 08:40
tracesbacks when using perun for the first time
boot --help ⏎
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
boot.App.main App.java: 500
boot.App.runBoot App.java: 407
org.projectodd.shimdandy.impl.ClojureRuntimeShimImpl.invoke ClojureRuntimeShimImpl.java: 145
org.projectodd.shimdandy.impl.ClojureRuntimeShimImpl.invoke ClojureRuntimeShimImpl.java: 154
...
boot.main/-main main.clj: 216
@mrchrisadams
mrchrisadams / Senior-Manager-Sustainability-Product-Innovation.md
Created December 16, 2019 10:37
Interesting MS sustainability tech roles, without the sign in guff

Senior Manager, Sustainability Product Innovation

Redmond, Washington, United States

  • Job number 742615
  • Date posted Nov 15, 2019
  • Travel 0-25 %
  • Profession Business Programs & Operations
  • Role type Individual Contributor
  • Employment type Full-Time
@mrchrisadams
mrchrisadams / Pipfile
Last active January 9, 2020 16:35
Get an idea of the timezone distribution in a slack workspace
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
slackclient = "*"
[dev-packages]
ipdb = "*"
@mrchrisadams
mrchrisadams / initial-submission.md
Last active February 24, 2021 09:04
The Open Green Web

This was the initial funding submission

Project title *

The Open Green Web

Assign the project to an area. {Civic Tech, Data Security, Data Literacy, Infrastruktur} *

Data infrastructure

@mrchrisadams
mrchrisadams / i_should_totally_know_this_by_now.py
Created September 4, 2018 11:42
How do I pass keywords in to this query() function in python?
set_o_tuples = [
("streetaddress", "burdon")
("area", "bungo"),
("region", "bingo"),
("some_other_key", "bango"),
])
for key, val in set_o_tuples:
# I want to run code like this, but keept it DRYer than
# literally typing the the code below
@mrchrisadams
mrchrisadams / example_send_code.py
Last active June 21, 2018 10:05
A rough sketch for how mjml and django-mail-builder would work
msg = build_message('email/welcome.email', {'user': request.user})
msg.send()
@mrchrisadams
mrchrisadams / total_disk_space.sql
Created June 8, 2018 14:05
How big are all the tables in the 'public' schema in postgres
WITH disk_tables AS
(SELECT nspname,
relname,
pg_relation_size(c.oid) AS "size"
FROM pg_class c
LEFT JOIN pg_namespace n ON (n.oid = c.relnamespace)
WHERE nspname IN ('public'))
SELECT pg_size_pretty(SUM(disk_tables.size)) FROM disk_tables;
@mrchrisadams
mrchrisadams / some_auth_wrapper.py
Created December 4, 2017 14:05
how should I mock and patch this?
from os import environ as env
import logging
from auth0.v3.management import Auth0
logger = logging.getLogger()
class SomeAuthWrapper():
"""
Wraps the API calls we need to make to administer users
@mrchrisadams
mrchrisadams / component.js
Last active November 30, 2017 10:09
puzzling over something simple in Vue
export default {
name: 'ProfileComponent',
// active tags is an array like ['foo', 'bar', 'baz']
props: ['auth', 'authenticated', 'profile', 'activetags'],
data() {
return {
ownProfile : true,
isActive: function (ev) {
// this isn't called at all
console.log("rendered on building the dom?")