Skip to content

Instantly share code, notes, and snippets.

Legend:

  • ⚠️ - no supporting xrefs
  • 🚫 - obsolete/not active
  • ❌ - invalid ID

1/4555: phenformin

  • ATC A10BA01 - phenformin according to PubChem Compound, ATC, MeSH, RxNorm, NDFRT, ChEMBL, KEGG Drug
  • 🆕 MeSH D010629 - Phenformin according to PubChem Compound, ATC, MeSH, RxNorm, NDFRT
@markwoon
markwoon / function_comparison.md
Last active September 19, 2022 22:04
Comparing DPWG vs CPIC functions

VKORC1

  • not in CPIC!

TPMT

  • *10: No function vs. Uncertain Function
  • *12: No function vs. Uncertain Function
  • *13: No function vs. Uncertain Function
  • *16: No function vs. Uncertain Function
@markwoon
markwoon / Announcement.stories.js
Created September 12, 2021 04:01
Test fetch in storybook
import fetchMock from 'fetch-mock';
import {useState} from 'react';
export default {
title: 'Components/Banner/Announcement',
component: AnnouncementBanner,
parameters: {
chromatic: {
// delay to make sure animation completes before chromatic takes snapshot
@markwoon
markwoon / happo_compare.js
Created July 28, 2021 22:09
Happo.io compare script
#!/usr/bin/env node
/* eslint-disable no-console */
const {execSync} = require('child_process');
const https = require('https');
if (!process.env.HAPPO_API_KEY || !process.env.HAPPO_API_SECRET || !process.env.SLACK_TOKEN) {
console.error('Missing HAPPO_API_KEY/HAPPO_API_SECRET/SLACK_TOKEN environment variable');
process.exit(1);
}
@markwoon
markwoon / jest.config.js
Created January 23, 2021 23:14
jest.config.js
// For a detailed explanation regarding each configuration property, visit:
// https://jestjs.io/docs/en/configuration.html
const esModules = ['ansi-regex', 'ky', 'ky-universal', 'strip-ansi'].join('|');
module.exports = {
// All imported modules in your tests should be mocked automatically
// automock: false,
// Stop running tests after `n` failures
@markwoon
markwoon / Yubikey-and-Cisco-Anyconnect.md
Last active April 23, 2024 12:31
Using Yubikey with Cisco AnyConnect

Yubikey + Cisco AnyConnect VPN

The default configuration for Yubikey is to support the CCID (Smart Card) interface. This does not play well with Cisco's AnyConnect VPN if you plan on connecting using a certificate on Windows.

When the CCID interface is enabled on the Yubikey, AnyConnect will produce a generic "The client agent has encountered an error" message when you try to use the certificate.

You will find something like these in the event viewer:

Date        : 09/01/2020
@markwoon
markwoon / IllustratorDetector.java
Created July 16, 2018 23:52
Utility class to check if a file is an Illustrator file based on XMP metadata.
import java.io.BufferedInputStream;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* This utility class checks if a file is an Illustrator file.
@markwoon
markwoon / TypeInfoTest.java
Last active November 15, 2017 00:15
Losing TypeInfo in BeanSerializerModifier
public class TypeInfoTest {
@Test
public void testTypeInfo() throws Exception {
Parent data = new Parent();
data.data.add(new TypedChild());
String json = new ObjectMapper().writer().writeValueAsString(data);
@markwoon
markwoon / Debounced.js
Created November 2, 2017 16:28
Debouncing in React
clase Foo extends React.Component {
componentWillUnmount = () => {
// make sure debounced method gets cancelled
this.method.cancel();
};
method = debounce(() => {
...
}, 100);
monitors_diagram_mark
digraph G {
node[fontsize=10]
{
node[shape=note color=blue]
PGKB_DATA_LISTENER
PGKB_CONNECTION_LISTENER
}
{
node[shape=folder color=green]