Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View askaaqib's full-sized avatar
⚒️
Same old, Same old

Aqib. askaaqib

⚒️
Same old, Same old
  • Pakistan
View GitHub Profile
@askaaqib
askaaqib / custom-form-plugin.php
Last active August 20, 2020 15:55
WordPress Custom Contact Form Plugin
<?php
/**
* Plugin Name: Investment Calculator
* Plugin URI:
* Description: Investment Calculator
* Version: 1.0
* Author: James Allen
* Author URI:
*/
@askaaqib
askaaqib / ajax_hook.php
Last active August 19, 2020 13:40
WordPress AJAX Function Hook
<?php
/****** CUSTOM POST TYPE = 'SERVICES' HOOKS *******/
add_action( 'wp_ajax_get_client_timezone_info', __NAMESPACE__ . '\\getTZInfo' );
add_action( 'wp_ajax_nopriv_get_client_timezone_info', __NAMESPACE__ . '\\getTZInfo' );
add_filter( 'the_content', __NAMESPACE__ . '\\replace_hello_with_good_morning' );
function replace_hello_with_good_morning($content){
session_start();
if(get_post_type()=='services'){
@askaaqib
askaaqib / category-permastructure.php
Last active August 20, 2020 15:54
WordPress Category Permastructure
<?php
function wpa85084_category_permastruct(){
global $wp_rewrite;
$wp_rewrite->extra_permastructs['category']['struct'] = '/blog/%category%/';
}
add_action( 'init', 'wpa85084_category_permastruct' );
add_action( 'init', 'wpa58471_category_base' );
function wpa58471_category_base() {
// Remember to flush the rules once manually after you added this code!
@askaaqib
askaaqib / agile-debug.php
Last active August 21, 2020 16:21
WordPress Custom Debug Plugin
<?php
/*
Plugin Name: Agile Debug
Plugin URI:
Description: Helps in developing/debugging Wordpress
Author: Aqib
Version: 1.4
Author URI: http://github.com
*/
@askaaqib
askaaqib / agile-debug-admin.css
Created August 21, 2020 16:41
Agile Debug CSS ADMIN
.agile_dbg_collapsible{
background: none repeat scroll 0 0 #CCCCCC;
border-top: 1px solid #F0F0F0;
color: #000000;
font-family: Arial,Helvetica,sans-serif;
@askaaqib
askaaqib / installDocker.sh
Last active October 2, 2020 13:40
Install Docker Ubuntu
apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
apt update
apt-cache policy docker-ce
apt install docker-ce
sudo curl -L "https://github.com/docker/compose/releases/download/1.26.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
@askaaqib
askaaqib / rlp.php
Last active November 6, 2020 05:10
RLPObject
<?php
$txBodyObj = new \FurqanSiddiqui\Ethereum\RLP\RLPObject();
$txBodyObj->encodeInteger("39");sh
//$txBodyObj->encodeInteger(2864434397);
$txBodyObj->encodeInteger(845527306194141);
$txBodyObj->encodeInteger(32);
$clause1 = new \FurqanSiddiqui\Ethereum\RLP\RLPObject();
$clause1->encodeHexString("9fdee3753061cc9033f8bcfb9fd81c18cc137f05");
@askaaqib
askaaqib / ecdsa.php
Last active October 19, 2020 13:37
ECDSA, Private to Public
<?php
declare(strict_types=1);
require "../vendor/autoload.php";
use FurqanSiddiqui\ECDSA\ECDSA;
use FurqanSiddiqui\ECDSA\Curves\Secp256k1;
use Comely\DataTypes\Buffer\Base16;
use \kornrunner\Keccak;
@askaaqib
askaaqib / sign_verify_signature.php
Created October 16, 2020 06:34
ECDSA, Sign and Verify Signature
<?php
declare(strict_types=1);
require "../vendor/autoload.php";
use FurqanSiddiqui\ECDSA\ECDSA;
use FurqanSiddiqui\ECDSA\Curves\Secp256k1;
use Comely\DataTypes\Buffer\Base16;
use \kornrunner\Keccak;
@askaaqib
askaaqib / skycoin.php
Last active August 18, 2022 03:48
SkyCoin SDK PHP
<?php
declare(strict_types=1);
require "../vendor/autoload.php";
$sky = new \SkyCoin\SkyCoin("192.168.100.27", 6420);
$walletFactory = new \SkyCoin\Wallets\WalletsFactory($sky);
echo "<pre>";
////GET BLOCK BY HEIGHT