Skip to content

Instantly share code, notes, and snippets.

Finding inspirations...

Heiswayi Nrird heiswayi

Finding inspirations...
View GitHub Profile
View enforce_dark_mode.js
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));
var rule = ':root{background-color:#fff;filter:invert(100%)}*{background-color:inherit}img:not([src*=".svg"]),video{filter:invert(100%)}';
View index.html
<!doctype html>
<html lang="en">
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
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 = ''

List all containers (only IDs)

docker ps -aq

Stop all running containers

docker stop $(docker ps -aq)
heiswayi / .gitignore
Created Jan 30, 2020
.gitignore for VisualStudio, VisualStudioCode, Notepad++
View .gitignore
# Created by,visualstudio,visualstudiocode
# Edit at,visualstudio,visualstudiocode
### NotepadPP ###
# Notepad++ backups #
### VisualStudioCode ###
heiswayi /
Created Jan 30, 2020
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 / .bashrc
Last active Jan 30, 2020
My LinuxLite .bashrc
View .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
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 /
Created Dec 31, 2019
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
View algorithms.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
public class Program
#region Bubble Sorts
You can’t perform that action at this time.