Skip to content

Instantly share code, notes, and snippets.

View paulkernstock's full-sized avatar

paulkernstock

View GitHub Profile
@paulkernstock
paulkernstock / literal_string.py
Last active June 19, 2023 16:08
Literal block scalars with PyYAML's dump
import yaml
from yaml.representer import SafeRepresenter
class LiteralString(str):
pass
def change_style(style, representer):
def new_representer(dumper, data):
scalar = representer(dumper, data)
@paulkernstock
paulkernstock / taiga-pg-restore.log
Created March 20, 2017 13:27
Taiga pg_restore log
(taiga) taiga@SHG-Simulationsserver:~$ sudo -u postgres pg_dump --format=custom --dbname=taiga --file=/home/taiga/Backup/shg-taiga-postgres.dump
(taiga) taiga@SHG-Simulationsserver:~$ sudo -u postgres pg_restore -d taiga /home/taiga/Backup/shg-taiga-postgres.dump
pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 310; 1255 17977 FUNCTION array_distinct(anyarray) taiga
pg_restore: [archiver (db)] could not execute query: ERROR: function "array_distinct" already exists with same argument types
Command was: CREATE FUNCTION array_distinct(anyarray) RETURNS anyarray
LANGUAGE sql
AS $_$
SELECT ARRAY(SELECT DIST...
pg_restore: [archiver (db)] Error from TOC entry 325; 1255 18514 FUNCTION clean_key_in_custom_attributes_values() taiga
@paulkernstock
paulkernstock / projects-curl.log
Last active March 20, 2017 13:22
taiga-back projects list
[{"description": "Project example 6 description", "default_us_status": 37, "created_date": "2017-03-20T12:17:14.297Z", "is_featured": false, "default_epic_status": 31, "is_kanban_activated": true, "total_fans_last_month": 9, "tags": ["quos", "voluptatibus", "culpa", "exercitationem", "quas", "voluptatum", "beatae", "nemo", "molestias"], "owner": {"full_name_display": "Mohamed Ortega", "username": "user7", "is_active": true, "gravatar_id": "6d7e702bd6c6fc568fca7577f9ca8c55", "photo": null, "big_photo": null, "id": 13}, "total_milestones": 5, "is_watcher": false, "is_backlog_activated": true, "members": [5, 11, 7, 9, 8, 14, 13, 12, 6, 15], "videoconferences": null, "i_am_member": false, "videoconferences_extra_data": null, "total_activity_last_year": 216, "total_activity_last_month": 216, "creation_template": 1, "totals_updated_datetime": "2017-03-20T12:18:17.872Z", "default_severity": 33, "looking_for_people_note": "", "public_permissions": ["view_project", "view_milestones", "view_epics", "view_us", "view_tas
@paulkernstock
paulkernstock / gist:5388404d633d2c659edd
Created November 18, 2015 14:51
"Internal error in code generation, please contact support."
dsmodel.c: In function TransiEntDevZone_Sketchbook_pk_Scratch_FooFunction:
dsmodel.c:124:7: error: unknown type name Bad
Bad Type i0_0_0;
^
dsmodel.c:124:17: error: expected =, ,, ;, asm or __attribute__ before i0_0_0
Bad Type i0_0_0;
^
dsmodel.c:133:25: error: i0_0_0 undeclared (first use in this function)
RealAssign (i0_0_0.c_0member, dummy_DymStruc1_1A.c_0member);
^
@paulkernstock
paulkernstock / gist:8ccbe87f3c7d8a9fb349
Created November 18, 2015 14:46
Reading out coefficients, dictionary style
record Dictionary "Dictionary record for getting values using name lookup"
parameter String name "Unique name used as identifier";
parameter Real c[:] "Coefficients";
end Dictionary;
record R
constant String name;
end R;
function FooFunction