Skip to content

Instantly share code, notes, and snippets.

View gakowalski's full-sized avatar
🏠
Working from home

Grzegorz Adam Kowalski gakowalski

🏠
Working from home
View GitHub Profile
@UnaNancyOwen
UnaNancyOwen / README.md
Last active September 4, 2023 11:07
OpenCV ObjDetect Module Face Detection (YuNet/libfacedetection) Sample

OpenCV ObjDetect Module Face Detection (YuNet/libfacedetection) Sample

  • Input
    input

  • Output
    output

Download

await new Promise(function (resolve) {
setTimeout(function () {
resolve();
}, 1000);
});
// ... Can be shortened to:
await new Promise(function (resolve) {
setTimeout(resolve, 1000);
@lukecav
lukecav / Command
Last active June 12, 2022 20:59
Delete all comments marked as hold and spam using WP-CLI
wp comment delete $(wp comment list --status=hold --format=ids)
wp comment delete $(wp comment list --status=spam --format=ids)
@mlocati
mlocati / win10colors.cmd
Last active June 16, 2024 17:49
ANSI Colors in standard Windows 10 shell
@echo off
setlocal
call :setESC
cls
echo %ESC%[101;93m STYLES %ESC%[0m
echo ^<ESC^>[0m %ESC%[0mReset%ESC%[0m
echo ^<ESC^>[1m %ESC%[1mBold%ESC%[0m
echo ^<ESC^>[4m %ESC%[4mUnderline%ESC%[0m
@arniebradfo
arniebradfo / wp-shortcode-add-body-class.php
Last active June 23, 2022 18:28
WordPress shortcode that adds classes to the html body
<?php // ...in functions.php
// adds wp shortcode that adds css classes to the html body
// use in your page and post content like this:
// [bodyclass class="add these classes to the body"]
function use_bodyclass_shortcode( $classes ) {
global $post;
// check if the post has the bodyclass shortcode
@jplhomer
jplhomer / disable-comments.sh
Created February 25, 2015 16:38
Disable all comments/pings in WordPress with WP-CLI
$ wp post list --format=ids | xargs wp post update --comment_status=closed
# Output:
# Success: Updated post 2514.
# Success: Updated post 2511.
# Success: Updated post 2504.
# Success: Updated post 2499.
# Success: Updated post 2441.
# etc...
@jasny
jasny / linkify.php
Last active May 26, 2024 20:40
PHP function to turn all URLs in clickable links
<?php
/**
* Turn all URLs in clickable links.
*
* @param string $value
* @param array $protocols http/https, ftp, mail, twitter
* @param array $attributes
* @return string
*/
public function linkify($value, $protocols = array('http', 'mail'), array $attributes = array())