Skip to content

Instantly share code, notes, and snippets.

@joshuadavidnelson
joshuadavidnelson / duplicate-child-term-url-structure.php
Last active April 18, 2024 00:05
Using a Parent > Child category structure with duplicate child url slugs; for urls like `category/parent-1/child` and `category/parent-2/child`.
<?php
/**
* Plugin Name: Duplicated Child Term Url Slugs
* Description: Duplicate child term urls slugs in hierarchical taxonomies.
* Version: 0.1.0
* Author: joshuadnelson
* License: GPLv2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
*
* This is setup like a plugin, but can be included in a theme or as a class in a plugin.
@letanure
letanure / estados-cidades.json
Last active April 18, 2024 00:03
JSON estados cidades do brasil, dividido por estados. segunda lista atualizada em 2020, dados do IBGE
{
"estados": [
{
"sigla": "AC",
"nome": "Acre",
"cidades": [
"Acrelândia",
"Assis Brasil",
"Brasiléia",
"Bujari",
@wolever
wolever / watchdog.py
Created December 2, 2016 23:57
A simple watchdog for long-running Python processes
"""
A simple watchdog for long running processes which may stall for some reason or
another.
If the main thread hasn't logged progress (by updating
``self.last_progress_time``) in WATCHDOG_HARD_KILL_TIMEOUT, the watchdog
thread will log an error containing the stack trace of all currently running
threads then use ``kill -9`` to kill the main process.
Assumes that a process monitor like supervisor or systemd will then restart
@Hakky54
Hakky54 / openssl_commands.md
Last active April 18, 2024 00:00 — forked from p3t3r67x0/openssl_commands.md
Some list of openssl commands for check and verify your keys

OpenSSL 🔐

Install

Install the OpenSSL on Debian based systems

sudo apt-get install openssl
@FranciscoG
FranciscoG / acf_repeater_shortcode.php
Last active April 18, 2024 00:00
An Advanced Custom Fields shortcode that allows to loop through a field with a repeater. This only handles simple cases, it can't handle nested repeater fields
<?php
/**
* ACF Pro repeater field shortcode
*
* I created this shortcode function because it didn't exist and it was being requested by others
* I originally posted it here: https://support.advancedcustomfields.com/forums/topic/repeater-field-shortcode/
*
* @attr {string} field - (Required) the name of the field that contains a repeater sub group
* @attr {string} sub_fields - (Required) a comma separated list of sub field names that are part of the field repeater group
* @attr {string} post_id - (Optional) Specific post ID where your value was entered. Defaults to current post ID (not required). This can also be options / taxonomies / users / etc
@alvinsu6
alvinsu6 / image-slider-with-multiple-controls-and-mobile-swipe-control-javascript.markdown
Created February 5, 2021 13:44
Image slider with multiple controls and mobile swipe control (Javascript)
@moonyl
moonyl / gist:6b1f1e18c0ed538209905599339931e3
Last active April 17, 2024 23:55
ffmpeg library debugging 가능하도록 build
./configure --enable-gnutls --disable-optimizations --enable-static --disable-shared --disable-stripping --disable-mmx \
--disable-ssse3 --enable-debug=3 --extra-cflags="-O0 -fno-inline" --enable-gpl --prefix=$HOME/dev-home
shader_type canvas_item;
uniform sampler2D spritesheet; // Should be a slice image as exported from Magica Voxel
uniform int slice_count = 1; // The number of slices
uniform vec2 camera_vec = vec2( 1., 1. ); // Recomend using (1,1) or (1,1.5)
uniform float camera_ang = 0.0; // change this to change the view angle of the object
const vec2 center = vec2( 0.5 );
bool scale_and_rotate_with_offset( inout vec2 uv, vec2 sxy, float ang, vec2 cent, vec2 offset )
@mmazzarolo
mmazzarolo / service-workers.md
Last active April 17, 2024 23:54
Service Workers Tips

Service Workers Tips

Reloading a service worker

Reloading a page won't update/remove the previous version of its service worker. To make sure you're using the latest version of your service worker, make sure to check the "Update on reload" toggle in the "Application" ⭢ "Service Workers" section of the Chrome DevTools.

Simulate a network condition

To simulate a network condition (e.g.: offline, 3g, etc...) in a service worker on Chrome, uncheck the "Update on reload" toggle.

@itsmikita
itsmikita / macos-iso.md
Last active April 17, 2024 23:54
Extract ISO image from macOS Somona installer