Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Prahlad Yeri prahladyeri

🏠
Working from home
View GitHub Profile
@prahladyeri
prahladyeri / hacker_news.user.js
Created Jun 22, 2019
Adding the missing "My Posts" and "My Comments" links on top of HackerNews website
View hacker_news.user.js
// ==UserScript==
// @name HN Addons
// @namespace https://prahladyeri.com
// @version 0.1
// @description Add custom bells and whistles to HN
// @author Prahlad Yeri
// @match https://news.ycombinator.com/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @grant none
// ==/UserScript==
@prahladyeri
prahladyeri / repo_puller.py
Created Jun 22, 2019
Pelican Plugin to fetch a given user's github repos in order of last commits
View repo_puller.py
##
# Repo Puller
#
# @description A plugin to pull your github repositories
# @author Prahlad Yeri<prahladyeri@yahoo.com>
# @license MIT
# @date 2019-06-20
#
# @modified:
# 2019-06-22: Cleaned up source, removed comments.
@prahladyeri
prahladyeri / gmail_classic.user.js
Created Aug 28, 2018
Userscript to add auto-refresh functionality to GMail Classic
View gmail_classic.user.js
// ==UserScript==
// @name GMail Classic
// @namespace https://prahladyeri.com
// @version 0.1
// @description Add refresh timer to GMail Classic
// @author Prahlad Yeri
// @match https://mail.google.com/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @grant none
// ==/UserScript==
@prahladyeri
prahladyeri / style.css
Created Jun 16, 2018
Stylesheet for the /r/FreelanceProgramming subreddit.
View style.css
div.sidebox.submit.submit-link a,
div.sidebox.submit.submit-text a,
div.sidebox.create div.morelink a
{
background-color: teal;
color: white;
font-family: monospace, mono, "Courier New", Courier;
letter-spacing: 0.1em;
}
@prahladyeri
prahladyeri / split_tweet.py
Created Sep 22, 2017
Python script to split your long tweet into small chunks of 140 characters limit imposed by Twitter
View split_tweet.py
#!/usr/bin/env python3
import os, sys
max_length = 140
def chunks(l, n):
for i in range(0, len(l), n):
yield l[i:i + n]
if __name__ == "__main__":
@prahladyeri
prahladyeri / tree
Created Sep 21, 2017
Python-3 implementation of the tree linux command
View tree
#! /usr/bin/env python3
__author__ = "Prahlad Yeri"
__license__ = "MIT"
__version__ = "0.0.1"
import os, sys
def print_tree(dirname, pref = ""):
for item in os.listdir(dirname):
@prahladyeri
prahladyeri / batteryboy
Created Sep 10, 2017
A small script to check laptop battery life on linux
View batteryboy
#!/usr/bin/env python3
import sys
import subprocess, os
from time import sleep, time
__author__ = "Prahlad Yeri"
__version__ = "1.0.7"
def execute_shell(command, error=''):
return execute(command, wait=True, shellexec=True, errorstring=error)
@prahladyeri
prahladyeri / disqus_parse.php
Created Sep 7, 2017
Tool to parse disqus comments xml file
View disqus_parse.php
<?php
/*
* Tool to parse disqus comments xml file.
*
* @author Prahlad Yeri<prahladyeri@yahoo.com>
* @date 2017-09-06
* */
function find_url($root, $thid) {
foreach($root->thread as $thread) {
@prahladyeri
prahladyeri / console.php
Last active Mar 29, 2020
Tool to import disqus comments to the wordpress system.
View console.php
<?php
/*
* Tool to migrate disqus comments to the wordpress system.
*
* @author Prahlad Yeri<prahladyeri@yahoo.com>
* @date 2017-09-06
*
* Updated on 2020-03-11: fixes and refactoring.
* */
require_once('disqus_parse.php');
@prahladyeri
prahladyeri / flask_drive_example.py
Created Dec 30, 2016
google drive api implementation in python-flask framework
View flask_drive_example.py
##
# Flask Drive Example App
#
# @author Prahlad Yeri <prahladyeri@yahoo.com>
# @date 30-12-2016
# Dependency:
# 1. pip install flask google-api-python-client
# 2. make sure you have client_id.json in this same directory.
import os