Skip to content

Instantly share code, notes, and snippets.

@ogallagher
ogallagher / permute.py
Last active December 31, 2020 06:51
Generate permutations in python
# dependencies
from typing import Union, List, Generator
# permute method
def permute(options:Union[str,List], places:int=None) -> Generator[List,None,None]:
"""Generate all permutations recursively.
Args:
@ogallagher
ogallagher / combinate.js
Created June 10, 2021 18:33
Generate combinations using elements from an array
function combinations(options,places) {
// options is array
// places is positive int
if (places <= 1) {
let c = []
for (let o of options) {
c.push([o])
}
@ogallagher
ogallagher / splitwise_logo_notext.svg
Created May 9, 2023 01:22
Splitwise logo (turquoise and gray open envelope) without text
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ogallagher
ogallagher / nlp_api_client.mjs
Last active February 19, 2024 16:10
Sandbox testing of natural language processing APIs
/**
* Test natural language APIs.
* - cloudmersive
* - detect language
* - tag parts of speech (POS)
*/
import dotenv from 'dotenv'
import cm from 'cloudmersive-validate-api-client'
import cm_nlp from 'cloudmersive-nlp-api-client'