Skip to content

Instantly share code, notes, and snippets.

View naveedn's full-sized avatar
🎯
Focusing

Naveed naveedn

🎯
Focusing
View GitHub Profile

Coding Rules and Instructions

  1. Test-Driven Development (TDD) with pytest: Always write a failing test before writing implementation code (Red-Green-Refactor). Use pytest and pytest-fixtures for test setup, execution, and teardown.
  2. KISS (Keep It Simple, Stupid): Favor the simplest solution that meets the requirements.
  3. DRY (Don't Repeat Yourself): Avoid code duplication. Extract reusable logic into functions or classes.
  4. Standard Libraries and Tools: Utilize standard Python libraries (like datetime for date/time, requests for HTTP requests, and logging) and external libraries, including BeautifulSoup4 for HTML parsing, to avoid reinventing the wheel. Favor well-maintained and widely-used libraries.
  5. YAGNI (You Ain't Gonna Need It): Don't implement features or functionality unless they are currently required.
  6. SOLID Principles & Extensibility: Adhere to SOLID principles, promoting maintainability, testability, and future extension. Consider potential future requi
@veekaybee
veekaybee / chatgpt.md
Last active March 10, 2025 07:45
Everything I understand about chatgpt

ChatGPT Resources

Context

ChatGPT appeared like an explosion on all my social media timelines in early December 2022. While I keep up with machine learning as an industry, I wasn't focused so much on this particular corner, and all the screenshots seemed like they came out of nowhere. What was this model? How did the chat prompting work? What was the context of OpenAI doing this work and collecting my prompts for training data?

I decided to do a quick investigation. Here's all the information I've found so far. I'm aggregating and synthesizing it as I go, so it's currently changing pretty frequently.

Model Architecture

@alukach
alukach / app.yaml
Last active July 24, 2024 13:54
An example Github Actions for Python + Pipenv + Postgres + Pyright
# .github/workflows/app.yaml
name: My Python Project
on: push
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 10
services:
@zillwc
zillwc / webcrypto_tests.js
Created April 17, 2020 11:00
Testing webcrypto functionality: encrypt, decrypt, wrapKey, unwrapKey, importKey, generateKey, and deriveKey
const KEY_OP_ALGO = 'AES-GCM';
const KEY_WRAPPING_ALGO = 'AES-KW';
const KEY_DERIVATION_ALGO = 'PBKDF2';
const encode = (t) => (new TextEncoder()).encode(t);
const decode = (t) => (new TextDecoder()).decode(t);
const bytesToArrayBuffer = (b) => new Uint8Array(b);
const areBuffersEqual = (buf1, buf2) => {
const a1 = bytesToArrayBuffer(buf1);
const a2 = bytesToArrayBuffer(buf2);
@acdlite
acdlite / app.js
Last active January 20, 2023 08:23
Quick and dirty code splitting with React Router v4
// getComponent is a function that returns a promise for a component
// It will not be called until the first mount
function asyncComponent(getComponent) {
return class AsyncComponent extends React.Component {
static Component = null;
state = { Component: AsyncComponent.Component };
componentWillMount() {
if (!this.state.Component) {
getComponent().then(Component => {
@takluyver
takluyver / 2to3_nb.py
Last active November 5, 2021 02:45
Run 2to3 on IPython notebooks
#!/usr/bin/env python3
"""
To run: python3 nb2to3.py notebook-or-directory
"""
# Authors: Thomas Kluyver, Fernando Perez
# See: https://gist.github.com/takluyver/c8839593c615bb2f6e80
import argparse
import pathlib
from nbformat import read, write
@amatellanes
amatellanes / celery.sh
Last active March 25, 2025 18:02
Celery handy commands
/* Useful celery config.
app = Celery('tasks',
broker='redis://localhost:6379',
backend='redis://localhost:6379')
app.conf.update(
CELERY_TASK_RESULT_EXPIRES=3600,
CELERY_QUEUES=(
Queue('default', routing_key='tasks.#'),
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active April 22, 2025 06:44
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@19h
19h / reset.js
Created February 19, 2013 22:51
Node.js — Clear Terminal / Console. Reset to initial state.
console.reset = function () {
return process.stdout.write('\033c');
}
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active April 22, 2025 06:39
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'