Skip to content

Instantly share code, notes, and snippets.

View salihdev0's full-sized avatar
:octocat:
Contributing

Salih salihdev0

:octocat:
Contributing
View GitHub Profile
@salihdev0
salihdev0 / setup.sh
Created April 24, 2026 21:06
first setup for a macbook
#!/bin/bash
# --- Macbook Pro Setup: Privacy-First & Performance-Driven ---
# Author: Sami Salih İbrahimbaş
# Purpose: Full environment automation
echo "🚀 Starting Ultimate Macbook Pro Engineering Setup..."
# 1. Install Homebrew
if ! command -v brew &> /dev/null; then
#!/bin/bash
# ==============================================================================
# Script Name: code-gpg
# Description: Decrypts a GPG file to RAM (/dev/shm), opens it in VS Code,
# and re-encrypts it upon closing.
# Dependency : gpg, code (VS Code)
# ==============================================================================
# 1. Check if a filename was provided
@salihdev0
salihdev0 / highlights.csv
Last active December 21, 2025 20:51
medium story table
Metric uber/fx Manual Wiring Difference
Dependency Resolution ~81,519 ns/op ~296 ns/op Manual is ~275x faster
Allocations ~1,004 allocs/op ~9 allocs/op FX allocates ~110x more
Memory Footprint ~66 KB/op ~1 KB/op FX uses ~66x more RAM
{
"makefile.configureOnOpen": false,
"kiroAgent.enableTabAutocomplete": true,
"go.toolsManagement.autoUpdate": true,
"go.useLanguageServer": true,
"go.inlayHints.parameterNames": true,
"go.inlayHints.rangeVariableTypes": true,
"go.inlayHints.constantValues": true,
"go.inlayHints.functionTypeParameters": true,
"go.inlayHints.compositeLiteralTypes": true,
@salihdev0
salihdev0 / encrypted-pem-to-jwk.go
Created March 19, 2025 19:13
Transform encrypted private keys to JWK
package main
import (
"crypto/rsa"
"crypto/x509"
"encoding/base64"
"encoding/json"
"encoding/pem"
"fmt"
"math/big"
@salihdev0
salihdev0 / vscode-config.md
Created November 23, 2024 12:44
My vscode configurations

Glass Effect on Autocomplete

Check how to install/enable section on VSXCode theme marketpleace.

Preview:

Screenshot 2024-11-23 at 15 31 21

Vertically Center Quick Search View

@salihdev0
salihdev0 / settings.json
Created November 22, 2024 22:46
vscode animated background
"background.fullscreen": {
"useFront": true,
"opacity": 0.02,
"images": [
"https://media4.giphy.com/media/OK5LK5zLFfdm/giphy.webp?cid=790b76113vqvgq5r811kqx6cilbmk3lcjvau1c26y8wgi797&ep=v1_gifs_search&rid=giphy.webp"
],
"interval": 0,
"random": false
}
@salihdev0
salihdev0 / ipv4.sh
Last active April 14, 2025 14:41
cloudflare-iptables sh group
#!/bin/bash
# Fetch Cloudflare IPv4 addresses directly from their official source
cloudflare_ips=$(curl -s https://www.cloudflare.com/ips-v4)
# If curl request fails, show error message and exit
if [ $? -ne 0 ]; then
echo "Error fetching Cloudflare IP addresses."
exit 1
fi
@salihdev0
salihdev0 / data.csv
Last active June 3, 2024 20:44
postgres jsonb operations
Operator Right Operand Type Description Example Example Result
-> int Get JSON array element (indexed from zero, negative integers count from the end) [{"a":"foo"},{"b":"bar"},{"c":"baz"}]'::json->2 {"c":"baz"}
-> text Get JSON object field by key {"a": {"b":"foo"}}'::json->'a' {"b":"foo"}
->> int Get JSON array element as text [1,2,3]'::json->>2 3
->> text Get JSON object field as text {"a":1,"b":2}'::json->>'b' 2
#> text[] Get JSON object at specified path {"a": {"b":{"c": "foo"}}}'::json#>'{a,b}' {"c": "foo"}
#>> text[] Get JSON object at specified path as text {"a":[1,2,3],"b":[4,5,6]}'::json#>>'{a,2}' 3
@salihdev0
salihdev0 / calc.go
Created April 24, 2024 18:54
survey calculator for twitter
package survey
func Calc(votes []int) []float64 {
totalVotes := 0
for _, v := range votes {
totalVotes += v
}
numOptions := len(votes)
results := make([]float64, numOptions)