Skip to content

Instantly share code, notes, and snippets.

View hasinhayder's full-sized avatar
🚀
Back on track, yayyyy!

Hasin Hayder hasinhayder

🚀
Back on track, yayyyy!
View GitHub Profile
<?php
/**
* WP SmartPay - bKash Gateway
*
* Plugin Name: WP SmartPay - bKash Gateway
* Plugin URI: https://wpsmartpay.com/
* Description:
* Tags: bKash
* Version: 0.1
@hasinhayder
hasinhayder / toUTF8Array.js
Created April 11, 2021 19:23 — forked from joni/toUTF8Array.js
toUTF8Array: Javascript function for encoding a string in UTF8.
function toUTF8Array(str) {
var utf8 = [];
for (var i=0; i < str.length; i++) {
var charcode = str.charCodeAt(i);
if (charcode < 0x80) utf8.push(charcode);
else if (charcode < 0x800) {
utf8.push(0xc0 | (charcode >> 6),
0x80 | (charcode & 0x3f));
}
else if (charcode < 0xd800 || charcode >= 0xe000) {
@hasinhayder
hasinhayder / README.md
Created April 8, 2021 18:15 — forked from mrbar42/README.md
Secured HLS setup with Nginx as media server

Secured HLS setup with Nginx as media server

This example is part of this article.

This is an example for an HLS delivery with basic security. Nginx compiled with nginx-rtmp-module & secure-link is used as media server. Features:

  • Domain filtering
  • Referrer filtering
  • Embed buster
@hasinhayder
hasinhayder / README.md
Created April 8, 2021 00:55 — forked from mrbar42/README.md
bash scripts to create VOD HLS stream with ffmpeg almighty (tested on Linux and OS X)

running:

bash create-vod-hls.sh beach.mkv

will produce:

    beach/
      |- playlist.m3u8
 |- 360p.m3u8
@hasinhayder
hasinhayder / example.html
Created April 8, 2021 00:48 — forked from onetdev/example.html
VideoJS + XHR mod : Adding XHR interceptor
<link media="all" rel="stylesheet" href="https://unpkg.com/video.js@7.1.0/dist/video-js.css">
<script src="https://unpkg.com/video.js@7.1.0/dist/video.js"></script>
<video-js id="player">
<source src="//video/index.m3u8" type="application/x-mpegURL" />
</video-js>
<script>
var player = videojs("player");
var prefix = "key://";
var urlTpl = "https://domain.com/path/{key}";
@hasinhayder
hasinhayder / DNS_TO_LOCALHOST.markdown
Created February 10, 2021 20:52 — forked from tinogomes/DNS_TO_LOCALHOST.markdown
Public DNS Pointing To localhost (127.0.0.1)

Available Wildcarded DNS Domains

It turns out that some kind hearted people already set up wildcarded domains for you already. You can use any domain below and/or any subdomain of these and they will always resolve back to 127.0.0.1 (your local machine). Here's the list of ones I know about. Let me know if there are more!

  • localhost - It will always works. Do you know why? I hope so.
  • [*.]fuf.me - Managed by @fidian; it will always point to localhost for IPv4 and IPv6
  • [*.]localtest.me
  • [*.]127-0-0-1.org.uk
  • [*.]vcap.me
  • [*.]yoogle.com
@hasinhayder
hasinhayder / elementor-assign-category-snippet.php
Created December 13, 2020 09:13 — forked from obiPlabon/elementor-assign-category-snippet.php
Asssign any elementor widget to a different category
<?php
/**
* Asssign any elementor widget to a different category
*
* To override the existing category just pass [ 'your-custom-category' ]
* And to keep existing [ 'your-custom-category', 'basic' ]
* here 'your-custom-category' is any registered category slug
*
* @param array $config
@hasinhayder
hasinhayder / elementor-disable-all-wp-widgets.php
Created December 12, 2020 18:24 — forked from obiPlabon/elementor-disable-all-wp-widgets.php
Disable or remove elementor widget from editor panel
<?php
/**
* Disable elementor registered widget.
*
* This will disable all WordPress native widgets
*
* @param \Elementor\Widgets_Manager $widgets_manager Instance of elementor widgets manager
*
* @author obiPlabon <https://obiPlabon.im>
*
@hasinhayder
hasinhayder / gist:148d1a7abdf8d9e33fabe9efb9e45e45
Created October 24, 2018 21:16 — forked from jamiemarsland/gist:5ee8f104bc6b19ca8e14d1414549c508
Change the WooCommerce 'return to shop' button link (with thanks to Nicola Mustone)
/**
* Changes the redirect URL for the Return To Shop button in the cart.
*
* @return string
*/
function wc_empty_cart_redirect_url() {
return 'http://yourdomain.com/your-page/';
}
add_filter( 'woocommerce_return_to_shop_redirect', 'wc_empty_cart_redirect_url' );