Skip to content

Instantly share code, notes, and snippets.

View jahir07's full-sized avatar

Jahirul Islam Mamun jahir07

  • Dhaka, Bangladesh
View GitHub Profile
@jahir07
jahir07 / IceCastPlaylist.php
Created October 29, 2022 11:00 — forked from sanderdewijs/IceCastPlaylist.php
This is an idea to create a playlist from an Icecast server storing the songdata and cover image into a database.
<?php
/**
* Class IceCastPlaylist
* See https://stackoverflow.com/questions/60502076/how-to-get-icecast-server-songs-history/60798774#60798774 for context
*
* This class can be used as follows:
* global $wpdb
* $playlistClass = new IceCastPlaylist($wpdb);
* $playlistClass->fetchSongInfo();
@jahir07
jahir07 / gist:06f0ab6b54067b638464520e8e7214a7
Created June 19, 2022 19:54 — forked from thinkphp/gist:1448754
Binary Search Tree Implementation in PHP
<?php
/**
* by Adrian Statescu <adrian@thinkphp.ro>
* Twitter: @thinkphp
* G+ : http://gplus.to/thinkphp
* MIT Style License
*/

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

@jahir07
jahir07 / WordPress: Owl Carousel in magnificPopup with ajax request
Last active December 29, 2020 07:38
WordPress: Owl Carousel in magnificPopup with ajax request
@jahir07
jahir07 / wordpress-import-update.php
Created September 2, 2020 09:26 — forked from balbuf/wordpress-import-update.php
Force the WordPress importer to update existing posts instead of skipping them
<?php
/**
* When using the WordPress Importer, update existing
* posts instead of skipping them. Updates content according
* to the import file even if the existing post was updated
* more recently.
*
* To use, drop this file into your /mu-plugins/ folder or
* copy this code into your functions.php file.
@jahir07
jahir07 / gist:ab3b67990b9667d454d04f09816e9f7b
Created August 31, 2020 06:14
Term Taxonomy Country list xml - WordPress
<?xml version="1.0" encoding="UTF-8" ?>
<!-- This is a WordPress eXtended RSS file generated by WordPress as an export of your site. -->
<!-- It contains information about your site's posts, pages, comments, categories, and other content. -->
<!-- You may use this file to transfer that content from one site to another. -->
<!-- This file is not intended to serve as a complete backup of your site. -->
<!-- To import this information into a WordPress site follow these steps: -->
<!-- 1. Log in to that site as an administrator. -->
<!-- 2. Go to Tools: Import in the WordPress admin panel. -->
<!-- 3. Install the "WordPress" importer from the list. -->
@jahir07
jahir07 / taxonomies.php
Created August 28, 2020 06:56 — forked from enricodeleo/taxonomies.php
Get and list all the taxonomies attached to a custom post type in Wordpress
<?php
$taxonomy_objects = get_object_taxonomies( 'cpt', 'objects' ); // <--- change cpt with the custom post type
$out = array();
foreach ( $taxonomy_objects as $taxonomy_slug => $taxonomy ){
$terms = get_terms( $taxonomy_slug, 'hide_empty=0' );
if ( !empty( $terms ) ) {
$out[] = "<strong>" . $taxonomy->label . "</strong>\n<ul>";
foreach ( $terms as $term ) {
$out[] =
" <li>"
@jahir07
jahir07 / gist:ed6f17ebf31e7ccdc4c36803afe7793c
Created February 27, 2020 20:25
React reload 404 issue fix. add following code in htaccess
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.html [QSA,L]
@jahir07
jahir07 / unshorten.php
Created October 15, 2019 17:29 — forked from marijn/unshorten.php
Unshorten URLS with PHP and CURL
<?php
/**
* @link http://jonathonhill.net/2012-05-18/unshorten-urls-with-php-and-curl/
*/
function unshorten_url($url) {
$ch = curl_init($url);
curl_setopt_array($ch, array(
CURLOPT_FOLLOWLOCATION => TRUE, // the magic sauce
CURLOPT_RETURNTRANSFER => TRUE,
@jahir07
jahir07 / file-upload.css
Last active May 25, 2020 18:18 — forked from gdarko/file-upload.css
WordPress Custom Profile Image Ajax Upload
.upload-thumb {
display: inline-block;
width: 120px;
height: 120px;
overflow: hidden;
background: #e2e2e2;
border: 1px solid #cdcdcd;
line-height: 120px;
margin-bottom: 10px;
}