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 / CreateResourceController.php
Created July 8, 2020 06:24
With the help of this command you can create a resource controller in CodeIgniter 4 just create a folder named Commands in app folder then create a php file with name CreateResourceController.php and paste the following code.
<?php
namespace App\Commands;
use CodeIgniter\CLI\BaseCommand;
use CodeIgniter\CLI\CLI;
use Config\Services;
/**
With the help of this command you can create a resource controller in CodeIgniter 4.
1) just create a folder named Commands in app folder
2) then create a php file with name CreateResourceController.php
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget{
@override
Widget build(BuildContext context){
return MaterialApp(
title: "Welcome to Flutter",
home: Scaffold(
appBar: AppBar(
title: Text("Welcome to Flutter App"),
@imranrbx
imranrbx / RoleComponent.vue
Created December 19, 2019 13:29
Solution to Arun Kumar's Issue for not updating record. it get closed before it actually commmit changes to roles array in the component
<template>
<v-data-table
item-key="name"
class="elevation-1"
:loading ="loading"
loading-text="Loading... Please wait"
:headers="headers"
:items="roles"
sort-by="calories"
>
<?php
/**
* Plugin Name: Pwspk Plugin
* Description: Description
* Plugin URI: http...
* Author: Author
* Author URI: http...
* Version: 1.0
* License: GPL2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
@imranrbx
imranrbx / Pong.py
Last active December 17, 2019 14:12
from turtle import Turtle, Screen, Pen
s = Screen()
s.setup(800, 600)
s.screensize(780, 580)
s.bgcolor('black')
s.title("Pong Game by Perfect Web Solutions")
s.tracer(0)
# ball
ball = Turtle('circle', visible=False)
ball.color('white')
@imranrbx
imranrbx / movement.py
Created December 29, 2018 12:31
Handling Turtle Movement with Keyboard
from turtle import Turtle, Screen
screen = Screen()
screen.setup(400, 400)
screen.screensize(380, 380)
screen.tracer(0)
t = Turtle()
t_right = 0.0
t.up = 90.0
t.down = 270.0
t.lef = 180.0
@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");