Skip to content

Instantly share code, notes, and snippets.

Avatar

David Bain pigeonflight

View GitHub Profile
@pigeonflight
pigeonflight / EventView.jsx
Last active Jan 17, 2022
example of relatedItems on an EventView
View EventView.jsx
/**
* 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 Jul 7, 2021
Valid buildout.cfg for Senaite LIMS July 6, 2021
View buildout.cfg
[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 Jul 6, 2021
Fast API with deta.sh and Paypal IPN (first working test)
View main.py
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
@pigeonflight
pigeonflight / portlets.xml
Last active Jun 6, 2020
Demo of a portlets xml that adds a Static portlet to Plone
View portlets.xml
<?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 Apr 22, 2022
ICD-11 Code Interpreter . This python script passes an ICD-11 code cluster and returns the interpretation (in English only at the moment)
View icd11-code-interpreter.py
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 Oct 2, 2022
This is an ugly script to just extract/unpack the ICD-11 codes from a local docker instance of the ICD-11 api
View README.md

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 Nov 26, 2019
2 - Final Input Page for BMI Calculator Layout
View input_page.dart
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 Nov 26, 2019
1 - Layout with Reusable Widget for BMI Calc
View input_page.dart
import 'package:flutter/material.dart';
class InputPage extends StatefulWidget {
@override
_InputPageState createState() => _InputPageState();
}
class _InputPageState extends State<InputPage> {
@override
Widget build(BuildContext context) {
View main.dart
main() {
print('Hello World');
}