Skip to content

Instantly share code, notes, and snippets.

View IC-Tech's full-sized avatar
🏠
Working from home

Imesh Chamara IC-Tech

🏠
Working from home
View GitHub Profile
@IC-Tech
IC-Tech / print_obj.py
Created February 28, 2022 18:01
python print function for classes/objects (with colors)
def print_obj(obj):
print('\033[36m', end='')
print(obj)
print('\033[0m', end='')
for att in dir(obj):
try:
val = obj.__getattribute__(att)
except AttributeError:
#print(' \033[31m' + att + '\033[0m')
continue
@IC-Tech
IC-Tech / dillinger.io.css
Created March 8, 2022 12:34
dark theme for dillinger.io
/*
- site: dillinger.io
- type: dark theme
- version: v1.0.0
- update: Tue 08 Mar 2022 12:30:06 PM UTC
- problems
- I chaned the font type as a effect, perview text looks smaller; remove the last style to revert.
- codeblock style with dark theme could be messy
- this is not a full patch, just only changed what I saw.
- little bit bored right now; will fix image buttons later.
@IC-Tech
IC-Tech / timer.sh
Created April 17, 2022 18:20
simple sleep timer with bash
#!/bin/bash
sec=0
function _t1 {
b="$2"
echo "${@:3}" | grep -oE "[0-9]+$1" | grep -oE '[0-9]+' | while read a ; do
printf "$((a * b)) + "
done
}
if [[ "$(echo "$1" | grep -oE '[HhMmSs]')" ]] ; then
v=`_t1 '[sS]' 1 "$@"`
@IC-Tech
IC-Tech / naming_convention.md
Created December 26, 2022 15:04
Naming convention in codes
Example Name
twowords flatcase
TWOWORDS UPPERCASE
twoWords (lower) camelCase, dromedaryCase
TwoWords PascalCase, UpperCamelCase, StudlyCase
two_words snake_case, pothole_case
TWO_WORDS SCREAMING SNAKE CASE, MACRO_CASE, CONSTANT_CASE
two_Words camel_Snake_Case
Two_Words Pascal_Snake_Case, Title_Case