Skip to content

Instantly share code, notes, and snippets.

View 0xkarambit's full-sized avatar
💭
Reborn

Karambit 0xkarambit

💭
Reborn
  • India
View GitHub Profile
module Main where
import Data.List (find, groupBy, intercalate, nub, sort, sortBy)
import Data.Ord
import Debug.Trace
-- Solution to
-- https://leetcode.com/problems/largest-number/description/
largest :: [Int] -> String
largest =
@0xkarambit
0xkarambit / paste.sh
Last active September 12, 2023 15:28
bash function to upload files to 0x0.st (with fzf)
function paste()
{
if [[ $# -gt 1 ]]; then
echo "USAGE: paste [File]"
return 1
fi
file=$1
# if no argument passed...
@0xkarambit
0xkarambit / opener.mjs
Last active April 22, 2022 17:05
script to open multiple urls from a text file
// Harshit Joshi, 22-04-2022
// MIT license
// unsafe dont use .... any arg can be placed in the urls file and it wont be filtered
import cp from "child_process";
import fs from "fs";
let COMMAND = `start firefox `;
function readUrls(file) {
@0xkarambit
0xkarambit / run.sh
Created October 15, 2021 19:06
runc
# mv ./run.sh /usr/bin/run
# https://stackoverflow.com/questions/18568706/check-number-of-arguments-passed-to-a-bash-script
if [ "$#" -ne 1 ]; then
echo "Illegal number of parameters" >&2;
exit 2;
fi
function getBaseName () {
echo -e "$1" | cut -d "." -f 1;
@0xkarambit
0xkarambit / cheat.sh
Created October 6, 2021 21:08
Simple one liner to cheat elegently | cheat.sh aliasing
curl "http://cheat.sh/$*"
# doesnt work if you use $@ instead of $*
# because $* doesnt preserve spaces while $@ does
# https://www.shellscript.sh/variables2.html
# The first set of variables we will look at are $0 .. $9 and $#.
# The variable $0 is the basename of the program as it was called.
# $1 .. $9 are the first 9 additional parameters the script was called with.