Skip to content

Instantly share code, notes, and snippets.

View spy16's full-sized avatar
🧑‍💻
Building

Shivaprasad Bhat spy16

🧑‍💻
Building
View GitHub Profile
package main
import (
"fmt"
"log"
"github.com/panjf2000/gnet/v2"
)
func main() {
@spy16
spy16 / server.go
Created May 7, 2024 06:39
gnet-play
package server
import (
"context"
"log"
"time"
"github.com/panjf2000/gnet/v2"
)
/// An expression that can be evaluated using eval().
#[derive(Debug, Clone, PartialEq, PartialOrd)]
pub enum Expr {
// Atoms - These evaluate to themselves.
Null,
Bool(bool),
Int(i64),
Float(f64),
// Eval types - These require logic for evaluation.
@spy16
spy16 / eval.rs
Last active January 29, 2024 04:35
rust-eval
use std::collections::HashMap;
use strum_macros::Display;
/// EvalErr is returned by eval() if evaluation fails.
#[derive(Debug)]
pub enum EvalErr {
WrongExpr { wanted: Expr, got: Expr },
WrongArity { wanted: usize, got: usize },
UnknownSymbol { symbol: String },
NotInvokable { got: Expr },
@spy16
spy16 / docker-compose.yml
Created July 12, 2023 05:00
All Infra Loally
version: '3.2'
services:
aerospike:
image: aerospike:ee-6.3.0.4_1
ports:
- "3000:3000"
volumes:
- type: "bind"
source: "./volumes/aerospike/data"
@spy16
spy16 / curl.sh
Created October 3, 2022 11:01
ducky_request
curl https://ducky-afkqinpvla-uc.a.run.app/v1/search \
-d '{"text": "link"}' \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiUmFodWwiLCJlbWFpbCI6ImJhbnNhbC5yYWh1bDE0QGdtYWlsLmNvbSIsInN1YiI6ImQ1ZTlkNGY0ZTllNmIzOWQ5MTY3ODRiNjAxZTQ4MTZlIiwiZXhwIjoxNjY0ODgxMjQ0LCJpYXQiOjE2NjQ3OTQ4NDR9.fVQ1duy8RpLB5XBe1uJ2vz6QwZw7KHSw4de3KIXlTec"
@spy16
spy16 / main.go
Created July 27, 2022 18:00
gpt3
package main
import (
"encoding/json"
"log"
"net/http"
"github.com/gorilla/mux"
)
format = """
$directory($rust$package$golang$python$ruby$git_branch$git_status$git_state$status)$cmd_duration$character
"""
scan_timeout = 10
add_newline = false
[cmd_duration]
min_time = 500
format = "( 🐌 [$duration](bold yellow))"
@spy16
spy16 / parens.py
Last active August 29, 2019 10:28
opposites = {
")": "(",
"]": "[",
"}": "{",
}
def check(s):
stack = []
for c in s:
@spy16
spy16 / go_snippets.md
Last active January 14, 2020 14:02
Go snippets for copy-pasting.