Skip to content

Instantly share code, notes, and snippets.

View HarshitJoshi9152's full-sized avatar
💭
Reborn

Karambit HarshitJoshi9152

💭
Reborn
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 =
@HarshitJoshi9152
HarshitJoshi9152 / 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...
@HarshitJoshi9152
HarshitJoshi9152 / 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) {
# 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;
@HarshitJoshi9152
HarshitJoshi9152 / 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.