Skip to content

Instantly share code, notes, and snippets.

@darraghmckay
darraghmckay / inscribe_py2_example.py
Created January 7, 2021 10:09
Inscribe Python2 requests example
import requests
API_KEY = "your-api-key" # https://docs.inscribe.ai/reference#authentication
headers = {'Authorization': API_KEY}
BASE_URL = "https://api.inscribe.ai/api/v2"
[a-z\:]+=\"(url\()?#?[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}\)?\"
@darraghmckay
darraghmckay / flatuicolors-export.js
Last active July 6, 2019 09:03
JS to export flatuicolors.com pallet to javascript contants
$$('.color').map(element => ({ color: element.getAttribute('style'), name: element.textContent.trim()})).map(({color, name}) => `export const ${name.replace(/[ -]/g, '_').replace(/'/g, '').toUpperCase()} = '${/background: (.+);/.exec(color)[1].replace(';', '')}';`).join('\n');
/*
Example on this pallet https://flatuicolors.com/palette/us
export const LIGHT_GREENISH_BLUE = 'rgb(85, 239, 196)';
export const FADED_POSTER = 'rgb(129, 236, 236)';
export const GREEN_DARNER_TAIL = 'rgb(116, 185, 255)';
export const SHY_MOMENT = 'rgb(162, 155, 254)';
export const CITY_LIGHTS = 'rgb(223, 230, 233)';
@darraghmckay
darraghmckay / spotifyTrackLinkExtractor.js
Last active April 3, 2023 22:18
Extract all spotify track URIs from a whatsapp conversation
$$('[tabindex="-1"] a').map(a => a.textContent).filter(link => /open\.spotify\.com\/track\/(.+)\?.+/.test(link)).map(trackLink => `spotify:track:${/open\.spotify\.com\/track\/(.+)\?.+/.exec(trackLink)[1]}`).join('\n')
@darraghmckay
darraghmckay / main.bib
Created February 19, 2018 21:07
Latex Report Template
% Put your Bibtex references here