Skip to content

Instantly share code, notes, and snippets.

View makkoncept's full-sized avatar

Mayank Nader makkoncept

View GitHub Profile
@makkoncept
makkoncept / github_last_commit.py
Created October 2, 2018 16:51
A python script to parse out github links of projects from a markdown file and then print the number of months from the last commit. Enter the access token for the github api
import mistune
import requests
from datetime import datetime
from bs4 import BeautifulSoup
# import time
f = open("<markdown file in the same directory>", "r") # enter the markdown file name
markdown_to_html = mistune.markdown(f.read())
@makkoncept
makkoncept / termcolor_colorama.py
Created January 5, 2019 19:25
testing termcolor and colorama
from termcolor import cprint, colored
import colorama
colorama.init()
# red, green, yellow, blue, magenta, cyan, white.
# on_red, on_green, on_yellow, on_blue, on_magenta, on_cyan, on_white.
# bold, dark, underline, blinkbold, dark, underline, blink, reverse, conceale, reverse, concealed
import html2text
from bs4 import BeautifulSoup
import os
from shutil import copy
path = os.path.join(os.getcwd(), "_posts")
_posts_files_list = os.listdir(path)
html_list = [file for file in _posts_files_list if ".html" in file]
import os
def update_content(file_path, content_list):
with open(file_path, 'w') as f:
f.writelines(content)
dirs = os.listdir(os.getcwd())
print(dirs)
import os
dirs = os.listdir(os.getcwd())
all_categories = []
for dir in dirs:
if dir == os.path.basename(__file__) or dir == "contents.lr" or dir == "blog-categories":
continue
import os
from lektor.pluginsystem import Plugin
class CheckfilePlugin(Plugin):
name = 'CheckFile'
description = u'Plugin to check if a file is present'
def on_setup_env(self, **extra):
{"employees1":[{"firstname":"John","age":30,"mail":"john@gmail.com"},{"firstname":"Jimmy","age":25,"mail":"jimmy@gmail.com"},{"firstname":"Jenny","age":22,"mail":"jenny@gmail.com"},{"firstname":"Jeremy","age":40,"mail":"jeremy@gmail.com"},{"firstname":"Justin","age":32,"mail":"justin@gmail.com"}],
"employees2":[{"firstname":"John","age":30,"mail":"john@gmail.com"},{"firstname":"Jimmy","age":25,"mail":"jimmy@gmail.com"},{"firstname":"Jenny","age":22,"mail":"jenny@gmail.com"},{"firstname":"Jeremy","age":40,"mail":"jeremy@gmail.com"},{"firstname":"Justin","age":32,"mail":"justin@gmail.com"}],
"employees3":[{"firstname":"John","age":30,"mail":"john@gmail.com"},{"firstname":"Jimmy","age":25,"mail":"jimmy@gmail.com"},{"firstname":"Jenny","age":22,"mail":"jenny@gmail.com"},{"firstname":"Jeremy","age":40,"mail":"jeremy@gmail.com"},{"firstname":"Justin","age":32,"mail":"justin@gmail.com"}],
"employees4":[{"firstname":"John","age":30,"mail":"john@gmail.com"},{"firstname":"Jimmy","age":25,"mail":"jimmy@gmail.com"},{"
9jFjt
@makkoncept
makkoncept / vscode-extensions.txt
Last active January 1, 2021 16:45
wget https://gist.githubusercontent.com/makkoncept/1f3b52783ed3c0a838c33ac0c237eb5c/raw/d5ec61986c937038fca311ca696733fc2a48b079/vscode-extensions.txt && while read line; do code --install-extension "$line"; done < vscode-extensions.txt && rm vscode-extensions.txt
dbaeumer.vscode-eslint
eamodio.gitlens
ritwickdey.liveserver
azemoh.one-monokai
esbenp.prettier-vscode
ms-python.python
burkeholland.simple-react-snippets
vscodevim.vim