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 / drawchecker.html
Created September 25, 2017 18:43
Draw a Checker board on Canvas Using Javascript and getContext with moveTo and lineTo
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style type="text/css">
#wrapper{
width: 600px;
height: 600px;
margin: auto;
<?php
namespace App\SocialMedia;
class Facebook{
protected $client_id;
private $client_secret;
public $redirect_url;
public function __construct($facebook){
$this->client_id = $facebook['client_id'];
<?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 {
<?php
add_action( 'add_meta_boxes', 'my_meta_box_add' );
add_action( 'save_post', 'save' );
function my_meta_box_add() {
add_meta_box( 'my-meta-box-id', 'Select The Chef for Food', 'my_meta_box', 'product', 'normal', 'high' );
}
function save( $post_id ) {
/*
* We need to verify this came from the our screen and with proper authorization,
@imranrbx
imranrbx / guess_the_number_game.py
Created December 20, 2018 18:15
This is a simple logical game, where computer thinks about a number from 1 to 10 and you have to guess the number in 3 tries.
import random
win = 0
tries = 0
count = 0
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 a 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");
@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 / 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 / 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 / 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')