This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Fetching the latest value of BSE-Sensex in just 9 lines of PHP code: | |
$data = http_build_query(array("client"=>"ig", "q" => 'BSE:SENSEX')); | |
$url = "http://finance.google.com/finance/info?"; | |
$ch = curl_init(); | |
$curlConfig = array( CURLOPT_URL => $url.$data, CURLOPT_RETURNTRANSFER => true); | |
curl_setopt_array($ch, $curlConfig); | |
$result = curl_exec($ch); | |
curl_close($ch); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A bunch of basic javascript utilities and helper functions. | |
* Depends on jQuery, Bootstrap. | |
* | |
* @author Prahlad Yeri (prahladyeri@yahoo.com) | |
* */ | |
function retrieveURL(filename) { | |
var scripts = document.getElementsByTagName('script'); | |
if (scripts && scripts.length > 0) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Common Utilities Library | |
* | |
* An open source library module for CodeIgniter Framework | |
* | |
* This content is released under the MIT License (MIT) | |
* | |
* Copyright (c) 2016, Prahlad Yeri | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.function.Predicate; | |
interface ProductFilter | |
{ | |
public boolean run(Product p); | |
} | |
public class Product |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Nice Reddit | |
// @namespace com.prahladyeri.userscripts.nice_reddit | |
// @creator prahladyeri@yahoo.com | |
// @description Beautify your Reddit! | |
// @homepage http://www.prahladyeri.com | |
// @include http://*.reddit.com/* | |
// @include https://*.reddit.com/* | |
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js | |
// @version 1.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# author: Prahlad Yeri | |
# description: Script to track bandwidth consumption and put in database. Place this in /etc/NetworkManager/dispatcher.d/ | |
import subprocess, os, datetime, sys | |
def execute(command): | |
try: | |
p=subprocess.Popen(command, shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE) | |
p.wait() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @author Prahlad Yeri | |
* @copyright MIT license | |
* @brief Custom javascript library for doing misc things. | |
* @date 28-01-2015 | |
*/ | |
/** | |
* @brief Constructor pattern for menu item. | |
* @param text Text to display on menu. "-" for divider. |
NewerOlder