Skip to content

Instantly share code, notes, and snippets.

View nkpro2000sr's full-sized avatar
🤔
Developing my project

NAVEEN S R nkpro2000sr

🤔
Developing my project
View GitHub Profile
@nkpro2000sr
nkpro2000sr / nouip.sh
Created September 14, 2021 11:53
To submit a dynamic dns update request from shell. https://www.noip.com/ (To update IP of HOSTNAME, update will happen instantly)
# {NO,Updatemy}IP
# https://www.noip.com/integrate/request
nouip ()
{
USER=""
PASSWORD=""
HOSTNAME=""
IP=""
@nkpro2000sr
nkpro2000sr / multiTank-multiPowerSource-singleMotor.png
Last active May 17, 2021 19:30
To pump water from a motor to multiple water tanks with different power source (Energy meter) respectively.
multiTank-multiPowerSource-singleMotor.png
@nkpro2000sr
nkpro2000sr / code.dpyt
Created March 21, 2021 19:45
Polyglot (Python & Dart) template
str ({format:#py, code:"""
'python'})
<< PYTHON Code without triple double quote >>
"""}){#dart;}
<< DART Code without triple double quote >>
//"""
@nkpro2000sr
nkpro2000sr / build_tf_src_colab.ipynb
Last active September 10, 2020 10:05
To build TensorFlow from source in colab
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nkpro2000sr
nkpro2000sr / kivy_buildozer_colab.ipynb
Last active March 29, 2023 13:15
colab with python, kivy, buildozer. To build apps easily online, no need to download SDK, NDK, ... 😩
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nkpro2000sr
nkpro2000sr / ToDownload.ipynb
Last active August 26, 2020 21:57
To download large files directly into google drive (later we can split and download)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nkpro2000sr
nkpro2000sr / setattr_after_timeout.py
Created June 22, 2020 20:47
To set/change value after timeout using Thread.
class _Setattr_after_timeout(threading.Timer):
""" To set values after timeout to attribute of a object """
def __init__(self, timeout, obj, **attrsAvalue):
"""
Args:
timeout (int):
Time (in seconds) after which value should be set to attribute of obj.
obj (object):
Object whose attributes have to set
@nkpro2000sr
nkpro2000sr / shlex_argparse.py
Created June 19, 2020 17:48
Parse positional and optional arguments from argstr. (var length 'pos & optional arguments' based on 'shlex')
import re
import shlex
def _until_dh(splited):
""" Slice until double hyphen """
i = 0
for i, s in enumerate(splited):
if s == "--":
return splited[:i], i+1
elif s.startswith("--"):
@nkpro2000sr
nkpro2000sr / discordRebot_anywhere.py
Last active June 14, 2020 06:52
To check Roles and Permissions from anywhere. https://github.com/nkpro2000sr/discord-rebot
"""
To make non strict mode Roles and Permissions checks for discord-rebot
Example::
Fn.auth = Roles['Admin'] # this will not allow DM or from other guild
Fn.auth = Anywhere(Roles['Admin']) # will allow
"""