Skip to content

Instantly share code, notes, and snippets.

@exul
exul / xml_unmarshal.go
Created November 6, 2023 14:26 — forked from suapapa/xml_unmarshal.go
golang: xml unmarshal practice
package main
import (
"encoding/xml"
"fmt"
"log"
)
var encoded = `
<list><value>a</value>
[Unit]
Description=Synapse Matrix homeserver
[Service]
Type=simple
User=synapse
Group=synapse
WorkingDirectory=/home/synapse/.synapse/
ExecStart=/home/synapse/.synapse/bin/python -B -m synapse.app.homeserver --config-path homeserver.yaml
# Obtain this key from
# https://developer.gitter.im/apps
gitter_api_key: "secret"
# The location of the homeserver this AS is configured for
matrix_homeserver: "https://exul.org:8448"
# The domain for locally-created users
matrix_user_domain: "exul.org"
** Message: pygobject_register_sinkfunc is deprecated (GstObject)
05/09/2016 19:54:50 (I) gajim.gajim: Encodings: d:utf-8, fs:UTF-8, p:UTF-8
05/09/2016 19:54:50 (D) gajim.c.resolver: Import of libasyncns-python failed, getaddrinfo will block
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/gajim/common/resolver.py", line 44, in <module>
import libasyncns
File "/usr/lib/python2.7/site-packages/gajim/common/demandimport.py", line 95, in _demandimport
return _import(name, globals, locals, fromlist, level)
ImportError: No module named libasyncns
05/09/2016 19:54:50 (I) gajim.c.resolver: Using HostResolver
@exul
exul / report.sql
Last active November 25, 2015 09:47
SELECT fundables.id AS project_id,
DATE_PART('year', fundables.started_at) AS start_year,
DATE_PART('year', fundables.started_at + INTERVAL '1 day' * fundables.duration) AS end_year,
ARRAY_AGG(pledges.id) AS pledge_ids
FROM fundables
INNER JOIN pledges
ON pledges.project_id = fundables.id
WHERE type = 'Project'
AND fundables.successful = 'f'
AND DATE_PART('year', fundables.started_at) != DATE_PART('year', fundables.started_at + INTERVAL '1 day' * fundables.duration)
### Keybase proof
I hereby claim:
* I am exul on github.
* I am exul (https://keybase.io/exul) on keybase.
* I have a public key whose fingerprint is EAF3 AA85 E1E6 8665 0CC1 B1CC E4B6 D46D 66C7 87CC
To claim this, I am signing this object: