Skip to content

Instantly share code, notes, and snippets.

@nickyreinert
nickyreinert / boilerplate.py
Last active Feb 22, 2021
Python script boilerplate with environment creation, code examples & telegram logging
View boilerplate.py
#!./bin/python
# prepare your virtual environment
######################################################################
# python3 -m venv ~/python_dev
# cd ~/python_dev
# source bin/activate
# manager requirements
######################################################################
@nickyreinert
nickyreinert / compare.ipynb
Created Dec 9, 2020
Script to quickly compare performance of seven different stemmers and lemmatizers focussed on German language
View compare.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nickyreinert
nickyreinert / functions.php
Created Aug 18, 2020
Set post tags when post is saved based on post title and regular expression
View functions.php
<?php
// functions.php is part of your child theme
function add_tags_to_post_on_save( $post_id ) {
// do not trigger if this is revision only
if ( wp_is_post_revision( $post_id ) ) {return;}
// get the current post title
View compareLookup.php
<?php
/*
available lookup methods:
in_array_strict
in_array_non_strict
foreach_strict
foreach_non_strict
isset
intersect
_array_search_strict