Skip to content

Instantly share code, notes, and snippets.

View pigeonflight's full-sized avatar

David Bain pigeonflight

View GitHub Profile
@pigeonflight
pigeonflight / EventView.jsx
Last active January 17, 2022 07:09
example of relatedItems on an EventView
/**
* EventView view component.
* @module components/theme/View/EventView
*/
import React from 'react';
import PropTypes from 'prop-types';
import { defineMessages, injectIntl } from 'react-intl';
import { flattenHTMLToAppURL } from '@plone/volto/helpers';
import { Container, Image, Segment, Header, List } from 'semantic-ui-react';
@pigeonflight
pigeonflight / buildout.cfg
Created July 7, 2021 01:45
Valid buildout.cfg for Senaite LIMS July 6, 2021
[buildout]
extends =
base.cfg
versions.cfg
# http://dist.plone.org/release/4.3.19/versions.cfg
# If you change your Plone version, you'll also need to update
# the repository link below.
find-links +=
http://dist.plone.org/release/4.3.19
@pigeonflight
pigeonflight / main.py
Created July 6, 2021 13:11
Fast API with deta.sh and Paypal IPN (first working test)
from fastapi import FastAPI, Request
import sys
import urllib.parse
import requests
app = FastAPI()
VERIFY_URL_PROD = 'https://ipnpb.paypal.com/cgi-bin/webscr'
VERIFY_URL_TEST = 'https://ipnpb.sandbox.paypal.com/cgi-bin/webscr'
# Switch as appropriate
#scoreBoard a#logo {
display: none;
}
@pigeonflight
pigeonflight / portlets.xml
Last active June 6, 2020 23:36
Demo of a portlets xml that adds a Static portlet to Plone
<?xml version="1.0"?>
<!-- locate this file under profiles/default/portlets.xml -->
<portlets>
<assignment name="proof-of-concept" category="context" key="/"
manager="plone.rightcolumn" type="plone.portlet.static.Static"
visible="True">
<property
name="text">Stuff to show in your proof of concept portlet</property>
<property name="more_url"/>
@pigeonflight
pigeonflight / icd11-code-interpreter.py
Last active January 7, 2023 08:26
ICD-11 Code Interpreter . This python script passes an ICD-11 code cluster and returns the interpretation (in English only at the moment)
import requests
import sys
#uri = 'http://localhost/icd/release/11/2019-04/mms/codeinfo/'
base_uri = 'http://localhost/icd/release/11/2019-04/mms/codeinfo/{}'
mms_uri = 'http://localhost/icd/release/11/2019-04/mms{}'
cluster_output = []
last_splitter = ""
try:
sample_cluster_code = sys.argv[1]
except IndexError:
@pigeonflight
pigeonflight / README.md
Last active March 10, 2024 14:43
This is an ugly script to just extract/unpack the ICD-11 codes from a local docker instance of the ICD-11 api

Assumptions

You have Python. You've installed the requests library. You have docker on your machine.

Usage

  1. Launch the ICD-11 docker container
docker run -p 80:80  --env "acceptLicense=true" --env "saveAnalytics=true" --env "includeIp=false" whoicd/icd11_sw_1904_mms_en
@pigeonflight
pigeonflight / input_page.dart
Created November 26, 2019 20:48
2 - Final Input Page for BMI Calculator Layout
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
class InputPage extends StatefulWidget {
@override
_InputPageState createState() => _InputPageState();
}
class _InputPageState extends State<InputPage> {
double _sliderValue = 125;
@pigeonflight
pigeonflight / input_page.dart
Last active November 26, 2019 15:42
1 - Layout with Reusable Widget for BMI Calc
import 'package:flutter/material.dart';
class InputPage extends StatefulWidget {
@override
_InputPageState createState() => _InputPageState();
}
class _InputPageState extends State<InputPage> {
@override
Widget build(BuildContext context) {
@pigeonflight
pigeonflight / main.dart
Created November 23, 2019 17:03
Dart Hello World
main() {
print('Hello World');
}