Skip to content

Instantly share code, notes, and snippets.

View public-daniel's full-sized avatar

Public Daniel public-daniel

View GitHub Profile
@sam-writer
sam-writer / mkpoetryproj.sh
Created May 14, 2020 22:29
Make Poetry and VSCode play nicely
mkpoetryproj ()
{
if [ $# -eq 1 ]; then
poetry new "$1"
cd "$1" || exit
# get gitignore
curl https://raw.githubusercontent.com/github/gitignore/master/Python.gitignore -o .gitignore
{
echo ""
echo ".vscode/"
@cbess
cbess / mysql-sp.md
Last active September 23, 2022 18:47
mysql stored procedure call from golang

A stored procedure that saves (insert/update) a URL, then returns the id for the record.

Works in Go v1.11.6+ and MySQL 5.7+.

DELIMITER ;;

CREATE DEFINER=`root`@`%` PROCEDURE SaveUrl(
    IN p_url varchar(8200),
    IN p_title text
@wpm
wpm / spacy_paragraph_segmenter.py
Created December 20, 2017 16:58
Segment a spaCy document into "paragraphs", treating whitespace tokens containing more than one line as a paragraph delimiter.
def paragraphs(document):
start = 0
for token in document:
if token.is_space and token.text.count("\n") > 1:
yield document[start:token.i]
start = token.i
yield document[start:]