Skip to content

Instantly share code, notes, and snippets.

View shivamsinha15's full-sized avatar

Shivam Sinha shivamsinha15

View GitHub Profile
@montasaurus
montasaurus / llmc.sh
Last active February 18, 2025 21:43
AI Shell Command Generator
llmc() {
local system_prompt='Output a command that I can run in a ZSH terminal on macOS to accomplish the following task. Try to make the command self-documenting, using the long version of flags where possible. Output the command first enclosed in a "```zsh" codeblock followed by a concise explanation of how it accomplishes it.'
local temp_file=$(mktemp)
local capturing=true
local command_buffer=""
local first_line=true
local cleaned_up=false # Flag to indicate whether cleanup has been run
cleanup() {
# Only run cleanup if it hasn't been done yet
@rauchg
rauchg / p.sh
Last active March 1, 2025 23:51
Perplexity CLI in pure shell
#!/usr/bin/env bash
function p() {
jq -n \
--arg content "$*" \
'{
"model": "pplx-7b-online",
"messages": [
{
"role": "system",
"content": "Be precise and concise."
@spinda
spinda / PROMPT.txt
Created December 28, 2022 22:30
ChatGPT splitting the check
Here is OCR'd text from a receipt:
"Dine-In
#15
<restaurant name redacted>
<address redacted> Phone <phone redacted>
@erikig
erikig / common-domain-prefix-suffix-list.tsv
Last active January 22, 2025 20:13
Top 5000 Most Common Domain Prefix/Suffix List - Courtesy LeanDomainSearch - https://leandomainsearch.com/top-domain-name-prefixes-and-suffixes/, Google Sheets version with changes to domain length - https://docs.google.com/spreadsheets/d/1BzZJ7BNek7ssUB2hWc6ChdF-mxN7QOE4U380Qx8uvR8/edit#gid=1626652908
Rank Type Prefix/Suffix Length
1 Prefix my+ 2
2 Suffix +online 6
3 Prefix the+ 3
4 Suffix +web 3
5 Suffix +media 5
6 Prefix web+ 3
7 Suffix +world 5
8 Suffix +net 3
9 Prefix go+ 2
@tomhicks
tomhicks / plink-plonk.js
Last active November 12, 2024 19:08
Listen to your web pages
@RossPfeiffer
RossPfeiffer / PoWHr.sol
Created October 12, 2019 17:11
PrismTokenomics.com
pragma solidity ^ 0.5.1;
contract PoWHr{
// scaleFactor is used to convert Ether into bonds and vice-versa: they're of different
// orders of magnitude, hence the need to bridge between the two.
uint256 constant scaleFactor = 0x10000000000000000;
int constant crr_n = 1;
int constant crr_d = 2;
int constant public price_coeff = -0x1337FA66607BADA55;
@bradtraversy
bradtraversy / node_nginx_ssl.md
Last active February 27, 2025 08:26
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@dominiek
dominiek / EtherDelta Fund Management.sol
Last active June 17, 2021 19:52
EtherDelta Fund Management
mapping (address => mapping (address => uint)) public tokens;
function deposit() payable {
tokens[0][msg.sender] = safeAdd(tokens[0][msg.sender], msg.value);
Deposit(0, msg.sender, msg.value, tokens[0][msg.sender]);
}
function withdraw(uint amount) {
if (tokens[0][msg.sender] < amount) throw;
tokens[0][msg.sender] = safeSub(tokens[0][msg.sender], amount);
@gabeweaver
gabeweaver / react-cognito-auth-js.js
Last active December 18, 2024 13:33
React + Cognito User Pools + Cognito Identity JS Example
/*
This example was built using standard create-react-app out of the box with no modifications or ejections
to the underlying scripts.
In this example, i'm using Google as a social provider configured within the Cognito User Pool.
Each step also represents a file, so you can see how I've chosen to organize stuff...you can do it however
you'd like so long as you follow the basic flow (which may or may not be the official way....but its what I found that works.
The docs are pretty horrible)
0x00 0 STOP
0x01 3 ADD
0x02 5 MUL
0x03 3 SUB
0x04 5 DIV
0x05 5 SDIV
0x06 5 MOD
0x07 5 SMOD
0x08 8 ADDMOD
0x09 8 MULMOD