Skip to content

Instantly share code, notes, and snippets.

View thechaudharysab's full-sized avatar

Chaudhry Talha thechaudharysab

View GitHub Profile
@{
ViewData["Title"] = "Index";
}
@section scripts {
<script src="~/Views/Employee/employee.js"></script>
}
<div class="module employees" style="padding: 15px">
% is used to add comments in code in prolog language
suggest(S) :- write('What is your personality type?: '),read(P),write('How is your mood?: '),read(M), song(S,_,M,P).
%Happy_Mood
song('https://www.youtube.com/watch?v=c8YIlU_30Kk',jazz,M,P):- M = happy ,(P= (entj) ; P=(enfj) ; P=(enfp)),!.
song('https://www.youtube.com/watch?v=SsZRci3sA4I',classical,M,P):- M = happy ,(P= (entj) ; P=(intj) ; P=(entp) ; P=(infj)),!.
song('https://www.youtube.com/watch?v=XYk2kt8K6E0',electronica,M,P):- M = happy ,(P= (entj) ; P=(estp) ; P=(enfp)),!.
song('https://www.youtube.com/watch?v=VguED7BfpgU',metal,M,P):- M = happy ,(P= (intj) ; P=(istp) ; P=(intp) ; P=(estp)),!.
song('https://www.youtube.com/watch?v=5f-wQBh-zbQ',alternative_rock,M,P):- M = happy ,(P= (intj) ; P=(entp) ; P=(infj) ; P=(infp) ; P=(istj) ; P=(isfj) ; P=(istp)),!.
song('https://www.youtube.com/watch?v=lPIiB02uqXM',rock,M,P):- M = happy ,(P= (entp) ; P=(intp) ; P=(infp) ; P=(istj) ; P=(isfj)),!.
import UIKit
struct Chat {
var users: [String]
var dictionary: [String: Any] {
return ["users": users]
}
}
extension Chat {
//
// QuestionViewController.swift
// WorseThanSiri
//
// Created by Chaudhry Talha on 9/16/19.
// Copyright © 2019 ibjects.com. All rights reserved.
//
import UIKit
import Firebase
@thechaudharysab
thechaudharysab / GIFSupport.swift
Last active February 16, 2019 06:55
Swift file that let you add GIF images in UIImageView
//
// GIFSupport.swift
//
// Created by Chaudhry Talha on 2/13/19.
// Copyright © 2019 ibjects. All rights reserved.
//
import UIKit
import ImageIO
@thechaudharysab
thechaudharysab / index.py
Created December 24, 2018 00:07
Adding the resource to our API and specify its route
api.add_resource(User, "/user/<string:name>") #<string:name> indicates that it is a variable part in the route which accepts any name.
app.run(debug=True, port=5001)
@thechaudharysab
thechaudharysab / index.py
Created December 24, 2018 00:02
Get, Post, Update & Delete using Flask
class User(Resource):
def get(self, name):
for user in users:
if(name == user["name"]):
return user, 200
return "User not found", 404
def post(self, name):
parser = reqparse.RequestParser()
@thechaudharysab
thechaudharysab / index.py
Created December 23, 2018 21:42
lists of users using Python data structures which are lists and dictionaries to simulate a data store
users = [
{
"name": "Nicholas",
"age" : 42,
"occupation": "Network Engineer"
},
{
"name": "Elvis",
"age" : 32,
"occupation": "Doctor"
@thechaudharysab
thechaudharysab / index.py
Created December 23, 2018 21:41
Importing the required module and setting up the Flask-RESTful application
from flask import Flask
from flask_restful import Api, Resource, reqparse
app = Flask(__name__)
api = Api(app)
@thechaudharysab
thechaudharysab / bar-chart-default-parm.py
Created June 24, 2018 23:11
Bar chart that only uses the default parameters from .bar()
# Create data.
colors = ['red', 'orange', 'yellow', 'green', 'blue', 'purple', 'magenta']
votes = [3, 2, 5, 1, 7, 0, 2]
index = [i for i in range(1, len(colors)+1)]
# Plot data.
plt.bar(index, votes)