Skip to content

Instantly share code, notes, and snippets.

View imranrbx's full-sized avatar
🏠
Working from home

Imran Qasim imranrbx

🏠
Working from home
View GitHub Profile
@imranrbx
imranrbx / wordpress-add-custom-menu-meta-fields.php
Created June 1, 2021 17:27 — forked from helgatheviking/wordpress-add-custom-menu-meta-fields.php
Add an example custom meta field to WordPress menu and display text on front-end (Requires WP5.4)
<?php
/**
* Add custom fields to menu item
*
* This will allow us to play nicely with any other plugin that is adding the same hook
*
* @param int $item_id
* @params obj $item - the menu item
* @params array $args
@imranrbx
imranrbx / triangle.py
Created December 26, 2018 15:17 — forked from hahalim/triangle.py
Asterisk triangle
num = int(input("Enter the number of rows "))
for i in range(1, num+1):
for j in range(num-i, num):
print("*", end="")
print()
@imranrbx
imranrbx / guessgame.py
Created December 26, 2018 08:03 — forked from hahalim/guessgame.py
Guess the number game
import random
win = 0
tries =0
count = 3
print ("Let's Play 'GUESS THE NUMBER' Game!")
ans = input("Are you ready to play? [yes/no] ")
while ans.lower() != "no":
print("I'm thinking number from 1 to 10, Guess It in 3 tries ")
guess = random.randint(1,10)
for count in range (3,0,-1):
@imranrbx
imranrbx / fizzbuzz.py
Created December 26, 2018 08:02 — forked from hahalim/fizzbuzz.py
FIZZBUZZ Solution
chance = ""
while (chance!="no"):
try:
num = int(input("Please enter a number\n"))
if (num%5==0 and num%3==0):
print("FizzBuzz")
elif (num%5 == 0):
print("BUZZ")
elif (num%3 == 0):
print("FIZZ");
<?php
# File: app\Http\Middleware\CORS.php
# Create file with below code in above location. And at the end of the file there are other instructions also.
# Please check.
namespace App\Http\Middleware;
use Closure;
class CORS {