Skip to content

Instantly share code, notes, and snippets.

View xyzshantaram's full-sized avatar

Siddharth Singh xyzshantaram

View GitHub Profile

Keybase proof

I hereby claim:

  • I am xyzshantaram on github.
  • I am xyzshantaram (https://keybase.io/xyzshantaram) on keybase.
  • I have a public key ASDKG-sHVY07ImTWs_YtDWzaZByvn72bPc768YG0sKqbewo

To claim this, I am signing this object:

@xyzshantaram
xyzshantaram / LICENSE
Created October 5, 2021 05:56
Client-side JS Linktree clone
The MIT License (MIT)
Copyright © 2021 Siddharth Singh
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@xyzshantaram
xyzshantaram / lemon.py
Last active October 7, 2021 18:53
lemonbar status emitter script
#!/usr/bin/env python3
from __future__ import annotations
import copy
import datetime
import os
import re
import statistics
import subprocess
@xyzshantaram
xyzshantaram / batmon.py
Created July 11, 2021 06:06
Battery monitor script for Linux computers.
#!/usr/bin/env python3
"""
Copyright © 2021 Siddharth Singh
The MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
NAME = main
CC ?= gcc # don't override CC if one is already set, or if the user has already set one
CFLAGS := -Wall -Wextra -Wunreachable-code
OBJ = main.o string_utils.o lmc.o
HEADER = string_utils.h lmc.h
OUTPUT_NAME = a.out
$(NAME): $(OBJ)
$(CC) -o $(OUTPUT_NAME) $(CFLAGS) $(OBJ)
#!/bin/bash
FGCOLOR='f5f4f0'
BGCOLOR='555555'
BG_ALPHA='51'
max_len=50
Clock() {
#TIME=$(date "+%S seconds past %H%M")
TIME=$(date "+%H%M+%S")
<html>
<meta charset='UTF-8'>
<head>
<div class='blackout'>
It appears you're using a mobile browser to view our site. Sadly, the HackerBlocks editor is desktop-only. Please visit this page in a desktop browser to do the challenge.
</div>
<style>
.blackout {
#!/bin/sh
## Put it into /usr/bin as "sound" so you can type snazzy commands like "sound up" and "sound down"
get_active_sink() {
local is_running=$(pactl list sinks | grep RUNNING); # empty if nothing is playing
if [ -z $is_running ]; then # nothing is playing; get the highest-number sink (the one which was plugged in last, which you're most likely to be using.)
local index_line_no=$(pactl list sinks | tac | awk '/State: SUSPENDED/{print NR + 1};')
IFS=' ' read -ra line_no_arr <<< "$index_line_no"
#!/bin/sh
echo "Backing up existing config files if any..."
if [ -d "$HOME/.config/openbox" ]; then
cp -r "$HOME/.config/openbox" "$HOME/.config/openbox.bak"
rm -r "$HOME/.config/openbox"
fi
mkdir ~/.config/openbox
@xyzshantaram
xyzshantaram / userChrome.css
Last active November 10, 2019 12:18
Firefox userChrome.css, forked from _mutex_
/* Remember to change your username */
/* @import url('file:///home/USERNAME/.cache/wal/colors.css'); */
#tabbrowser-tabs .tabbrowser-tab[selected] .tab-content {
background: #f5f4f0 !important;
border-radius: 12px;
padding-right: 3px;
padding-left: 3px;
padding-top: 2px;