Skip to content

Instantly share code, notes, and snippets.

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

Rafeh Qazi CleverProgrammer

🏠
Working from home
View GitHub Profile
'use server';
import { streamObject } from 'ai';
import { openai } from '@ai-sdk/openai';
import { createStreamableValue } from 'ai/rsc';
import { z } from 'zod';
import { createAnthropic } from '@ai-sdk/anthropic';
const anthropicAI = createAnthropic({
// custom settings
@CleverProgrammer
CleverProgrammer / Procfile
Last active July 28, 2019 05:19
How to Host a Django App on Heroku
web: gunicorn project_name.wsgi
@CleverProgrammer
CleverProgrammer / ninja-magnet
Created February 7, 2017 22:41
cfe_cleverprogrammer
# How TeamCFE Helped Me Make $21,765 From One Client, Build A Badass Web App, and Triple My Hourly Rates as a College Student in Under 2 Months
So, it was 1:20 pm on a Tuesday and I had just gotten back from my Intro to Differential Equations class which taught me about everything that had 0 application to my life. Just another day at college. It's weird how you can get by in school getting A's or B's without actually knowing anything. Anyways, as I step into my house with my black backpack still on – I get a phone call from somebody and let's just say his name was, err, Bob. Courtesy of NDAs.
## The Story of The Ultimate Call
So, Bob says that he just saw my independent software consultant ad on Craigslist. His company was looking for someone who could build software that could do the following:
- Send and track invoices
- Schedule jobs on a calendar with a beautiful GUI
- Register their employees and clients in a centralized database
for i in range(5):
print(i)
"""
Try-Except
Catch NameError, ZeroDivisionError, and ValueError
Try-Except-Finally
Catch IOerror and use finally.
Assert Statements
Write minutes_to_hours function and assert minutes to be a non-negative.
"""
@CleverProgrammer
CleverProgrammer / add_two.py
Last active October 16, 2016 22:22
Write a function add_two ​that takes in two numbers as input and returns their sum.
def add_two(a, b):
return a + b
print(add_two(1, 2)) # --> 3
"""
Author: Rafeh Qazi
Program: Encryption and Decryption
Resource: http://www.practicalcryptography.com/ciphers/caesar-cipher/
"""
# Use whatever key as long as it is consistent.
KEY = 17
@CleverProgrammer
CleverProgrammer / read_write_sort.py
Created October 13, 2016 19:17
UIC MCS 260 College Project. We cover how to read, write, and sort.
"""
Author: Rafeh Qazi
Course: MCS 260 at UIC (Intro CS)
Modified: October 2016
Program: Worksheet 6
"""
def best_way_to_read_file(file_name):
"""This is the best way, other ways kind of suck and are not pythonic. """
@CleverProgrammer
CleverProgrammer / caesar_custom_encryption.py
Created October 13, 2016 05:01
Using the idea of caesar cipher, we create our own custom caesar cipher.
"""
Author: Rafeh Qazi
Program: Encryption and Decryption
Resource: http://www.practicalcryptography.com/ciphers/caesar-cipher/
"""
KEY = 17
def caesar_encryption(letter, key):
@CleverProgrammer
CleverProgrammer / print_in_order.py
Created September 28, 2016 15:03
Sort 3 integers in order and print them out using only 3 if statements at most.
def print_in_order(a, b, c):
if a >= b:
if b >= c:
print(c, b, a)
elif a >= c:
print(b, c, a)
else:
print(b, a, c)
else: