Skip to content

Instantly share code, notes, and snippets.

View Cosmicoppai's full-sized avatar
👾
Learning transport protocols

Cosmic Oppai Cosmicoppai

👾
Learning transport protocols
View GitHub Profile
@Cosmicoppai
Cosmicoppai / bash_tidbits.md
Created May 19, 2024 11:18 — forked from wcarhart/bash_tidbits.md
Helpful Bash design patterns

Helpful Bash tidbits

@Cosmicoppai
Cosmicoppai / proc.rb
Created December 26, 2023 13:09
proc in ruby
# In Ruby, a Proc is an object that represents a block of code that can be stored in a variable.
# It's a way to create an anonymous function or code block that can be assigned to a variable and passed around in your program.
# Procs are instances of the Proc class.
# Here's a basic example of using a Proc:
full_name = Proc.new{ |first, last| first + " " + last}
p full_name["Mashiro", "Moritaka"] # we can call proc using [], using the bracket followed by the arguments
p full_name.call("Azuki", "Miho") # we can also call proc using call method
@Cosmicoppai
Cosmicoppai / addessBook.sh
Created December 16, 2021 09:00
Address Book using shell Script
#!/usr/bin/env sh
# Program to implement an address book with options given below
#1. create the database
#2. View address book
#3. Insert a Record
#4. Delete a Record
#5. Modify the Record
#6. Exit
@Cosmicoppai
Cosmicoppai / horny.sh
Created November 26, 2021 21:00
Script to search on pornhub in incognito
#!/bin/sh
query="$1"
if [ "$query" == '' ]; then
read -p "Enter Porn name/category: " query
fi
# curl https://jp.pornhub.com/video/search?search="$query"
start "brave" --incognito "https://jp.pornhub.com/video/search?search="$query""
@Cosmicoppai
Cosmicoppai / sorting.sh
Created October 3, 2021 09:38
Shell Script of Bubble sort
echo "Enter number of elements"
read k
echo "enter array elements"
for ((i=0; i<k; i++))
do
read a[$i]
done
for ((i=0; i<k; i++))
do