Skip to content

Instantly share code, notes, and snippets.

@iqbalrony
iqbalrony / wp-custom-reset-password-form.php
Last active March 6, 2024 16:09
WordPress custom reset password form
<?php
/*
*Example Follw:-https://code.tutsplus.com/tutorials/build-a-custom-wordpress-user-flow-part-3-password-reset--cms-23811
*/
// Create the custom pages at plugin activation
register_activation_hook( __FILE__, 'dgm_plugin_activated' );
function dgm_plugin_activated() {
// Information needed for creating the plugin's pages
$page_definitions = array(
@juliovedovatto
juliovedovatto / remove_duplicates_array_multi.js
Created December 3, 2016 19:42
Javascript: Remove duplicates of multidimensional array
// for browser using, this code requires javascript 1.7+
var arr = [
{ foo: 'bar', lorem: 'ipsum' },
{ foo: 'bar', lorem: 'ipsum' },
{ foo: 'bar', lorem: 'ipsum dolor sit amet' }
];
arr = arr.map(JSON.stringify).reverse() // convert to JSON string the array content, then reverse it (to check from end to begining)
.filter(function(item, index, arr){ return arr.indexOf(item, index + 1) === -1; }) // check if there is any occurence of the item in whole array
@m4tthumphrey
m4tthumphrey / ConcatAudioFilter.php
Last active September 5, 2020 07:17
php-ffmpeg concat audio filter - an incredibly simple filter to concat multiple audio files together. Should be easily tweaked to allow for videos too.
<?php
use FFMpeg\Media\Audio;
use FFMpeg\Format\AudioInterface;
use FFMpeg\Filters\Audio\AudioFilterInterface;
class ConcatAudioFilter implements AudioFilterInterface
{
private $files;
private $priority;