Skip to content

Instantly share code, notes, and snippets.

View heiswayi's full-sized avatar
👽

Heiswayi Nrird heiswayi

👽
View GitHub Profile
@heiswayi
heiswayi / enforce_dark_mode.js
Created October 17, 2020 20:16
Enforce dark mode
function addCss(rule) {
let css = document.createElement('style');
css.type = 'text/css';
if (css.styleSheet) css.styleSheet.cssText = rule;
else css.appendChild(document.createTextNode(rule));
document.getElementsByTagName("head")[0].appendChild(css);
}
var rule = ':root{background-color:#fff;filter:invert(100%)}*{background-color:inherit}img:not([src*=".svg"]),video{filter:invert(100%)}';
addCss(rule);
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
def disable(self):
self.HEADER = ''
@heiswayi
heiswayi / docker.md
Last active September 1, 2020 08:30

List all containers (only IDs)

docker ps -aq

Stop all running containers

docker stop $(docker ps -aq)
@heiswayi
heiswayi / git_log.sh
Created January 30, 2020 11:32
The ultimate graph display for your git log
git log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
@heiswayi
heiswayi / .bashrc
Last active January 30, 2020 11:28
My LinuxLite .bashrc
# enable bash completion in interactive shells
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
alias usage='du -sk * | sort -n | perl -ne '\''($s,$f)=split(m{\t});for (qw(K M G)) {if($s<1024) {printf("%.1f",$s);print "$_\t$f"; last};$s=$s/1024}'\'
@heiswayi
heiswayi / getFiles.py
Created December 31, 2019 16:13
Python script for getting a list of files in a directory
import os
def getListOfFiles(dirName):
# create a list of file and sub directories
# names in the given directory
listOfFile = os.listdir(dirName)
allFiles = list()
# Iterate over all the entries
for entry in listOfFile:
# Create full path
@heiswayi
heiswayi / algorithms.cs
Created December 20, 2019 15:44
Algorithms in C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
public class Program
{
#region Bubble Sorts

Keybase proof

I hereby claim:

  • I am heiswayi on github.
  • I am heiswayi (https://keybase.io/heiswayi) on keybase.
  • I have a public key whose fingerprint is 7F4E 5907 A6AB 0D10 BADC ABE3 B7B7 B2B1 9180 5E81

To claim this, I am signing this object:

#!/bin/bash
##########
# contents
##########
# contents
# notes
# script setup
# git config files