Skip to content

Instantly share code, notes, and snippets.

View rohithreddy's full-sized avatar
🐢
working from dreams

Rohith rohithreddy

🐢
working from dreams
View GitHub Profile
@rohithreddy
rohithreddy / vibecheckgen.py
Created September 8, 2024 16:45 — forked from cloneofsimo/vibecheckgen.py
vibecheckgen.py
import requests
import json
import base64
from PIL import Image
from io import BytesIO
import os
import openai
from openai import OpenAI
import fal_client
@rohithreddy
rohithreddy / clean_code.md
Created July 3, 2024 03:34 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

const flow = await Functions.makeHttpRequest({
url: `https://flow.hydragpt.xyz/api/chainfun`,
// url: `http://localhost:3000/api/chainfun`,
// "Flow-API-Key": `${secrets.flowKey}`,
method: "POST",
headers: {
"Content-Type": "application/json",
},
data: {
@rohithreddy
rohithreddy / list.py
Created January 25, 2022 09:22 — forked from fellu/list.py
Auto-list NFTs on OpenSea with Browser Automation
# First install Chrome, and the Selenium driver
# Next, download and save the MetaMask CRX (there are plenty of guides on how to do this)
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
import time
@rohithreddy
rohithreddy / clone_all.sh
Created June 15, 2021 16:44
Clone all repos in a github org
curl -s "https://api.github.com/users/ORG/repos?per_page=100" | jq -r ".[].git_url" | xargs -L1 git clone
@rohithreddy
rohithreddy / main.py
Created May 29, 2021 22:38 — forked from ohaz/main.py
Parse math formulas in python and put parentheses around Mult/Div
from __future__ import print_function
import ast
def recurse(node):
if isinstance(node, ast.BinOp):
if isinstance(node.op, ast.Mult) or isinstance(node.op, ast.Div):
print('(', end='')
recurse(node.left)
recurse(node.op)
@rohithreddy
rohithreddy / Create unencrypted CRT and KEY from PFX.MD
Created September 24, 2020 19:15 — forked from datvm/Create unencrypted CRT and KEY from PFX.MD
Create (no password/unencrypted) CRT and KEY certificates from PFX

Sometimes you may need an unencrypted pair for your certificate (in my case, I need it for Docker Registry).

You can use OpenSSL to generate one. You will need:

  • OpenSSL (if you use Windows, you can get OpenSSL for Windows)
  • A certificate in PFX format inputfile.pfx (you can convert from other formats using OpenSSL too). You will of course need its password. It is useless if you do not have it, just throw that file away.

Create (encrypted) key file:

First, you need to create a key file using the following command:

@rohithreddy
rohithreddy / kernel_upgrade.sh
Created November 8, 2019 20:22
Gentoo Kernel upgrade / build
eselect kernel list
eselect kernel set #
# Use current kernel config and store copy
gunzip /proc/config.gz -c > /root/config; cp /root/config /root/config-$(uname -r)
# Optionally change module settings in the config file, or use --menuconfig
# with genkernel.
genkernel --makeopts=-j9 --splash --kernel-config=/root/config all
@rohithreddy
rohithreddy / xmonad.hs
Created April 4, 2019 22:59 — forked from tylevad/xmonad.hs
XMonad window manager config
{-# LANGUAGE TypeSynonymInstances, DeriveDataTypeable, MultiParamTypeClasses, NoMonomorphismRestriction #-}
-- Ty Levad - [email protected]
-- xmonad.hs
-- Core Modules
import System.Exit
import XMonad hiding ((|||))
import qualified XMonad.StackSet as W
-- Action Modules
@rohithreddy
rohithreddy / nginx_sites_enabled_local_proxy
Created March 17, 2019 21:06
conf file for running Nginx as reverse proxy
server { # simple load balancing
listen 80;
location / {
proxy_pass http://localhost:3000;
}
}