Skip to content

Instantly share code, notes, and snippets.

Making Watomatic helping you move to private messengers

Deekshith Allamaneni adeekshith

Making Watomatic helping you move to private messengers
View GitHub Profile
adeekshith /
Created Oct 14, 2020 — forked from bxparks/
Simple Bash Shell Command Line Processing Template
# Self-contained command line processing in bash that supports the
# minimal, lowest common denominator compatibility of flag parsing.
# -u: undefined variables is an error
# -e: exit shell on error
set -eu
function usage() {
adeekshith /
Created Dec 15, 2017
Used for keybase authentication

Keybase proof

I hereby claim:

  • I am adeekshith on github.
  • I am adeekshith ( on keybase.
  • I have a public key ASDaFYYNIw727fCxfwv9n9rKdpw8eTJcPUGzxQe1uZ2QuQo

To claim this, I am signing this object:

adeekshith / custom-search-search-engines.json
Created Jan 20, 2017
Sample search engines collection for Custom Search Webextension
View custom-search-search-engines.json
"application" : {
"name" : "Custom Search",
"app_id" : "",
"version" : "v0.1"
"search_engines" : [
"category": "General",
"name": "DuckDuckGo",
adeekshith /
Created Jun 1, 2016
Testing performance between `Integer == int` vs `int == Integer`
import java.util.Arrays;
import java.util.List;
import java.util.ListIterator;
public class IntegerTest {
public static void main(String[] args) {
long startTime;
long duration;
long endTime;
adeekshith / .git-commit-template.txt
Last active Apr 9, 2021 — forked from Linell/.git-commit-template.txt
This commit message template helps you write great commit messages and enforce it across teams.
View .git-commit-template.txt
# <type>: (If applied, this commit will...) <subject> (Max 50 char)
# |<---- Using a Maximum Of 50 Characters ---->|
# Explain why this change is being made
# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->|
# Provide links or keys to any relevant tickets, articles or other resources
# Example: Github issue #23
adeekshith /
Created Nov 6, 2015
Applies cURL on every URL in the given file and saves by line number. Each line in the input file should be a URL
while IFS='' read -r line || [[ -n "$line" ]]; do
echo "Processing line $lineNum : $line"
curl -A "Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv: Gecko/20100401 Firefox/3.6.3" $line -o scraped-html/$lineNum.html
echo "Waiting for $delayNow sec"
sleep $delayNow
done < "$1"
adeekshith / simple-website-monitor.nb
Created May 5, 2015
Simple website monitoring script in Mathematica to monitor and visualize any given website performance over time.
View simple-website-monitor.nb
(* Monitors given website load time and plots it *)
dataLength = 400;
timeTakenUrlReq :=
timeTakenTime := {DateList[], timeTakenUrlReq};
data = {timeTakenTime};
Dynamic[Last[AppendTo[data, timeTakenTime]], UpdateInterval -> 10,
TrackedSymbols -> {}]
Dynamic[If[Length[data] < dataLength, Length[data = data],
Length[data = data[[-dataLength ;;]]]]]
View validate-json.nb
(* Gets JSON from a URL and extracts the data *)
(* Gets response in JSON format *)
apiResponse1 = Import["http://****", "JSON"];
(* Check returns 0 if an error occurs and Quiet supresses displaying errors *)
Quiet@Check[apiResponse1, 0]
(* Get response from JSON hierarchically *)
"latitude" /. ("prediction" /. apiResponse1)
(* latitude and prediction are the data keys in the JSON *)
adeekshith / function-overloading.nb
Created May 2, 2015
Example for function overloading in Mathematica
View function-overloading.nb
(* Function overloading in Mathematica *)
SumMultiply[x_?NumericQ, y_Real] :=
{sum, mul},
sum = x + y;
mul = x y;
{sum, mul}
SumMultiply[x_Integer, y_Real] :=
adeekshith / random-password-generator.nb
Last active Aug 29, 2015
This script generates pseodu random password or string of a given length
View random-password-generator.nb
(* Pseudo Random Password generator of given length*)
(* Get all \
characters you would like to be a part of your password *)
letters[] := StringSplit[FromCharacterCode[Range[33, 126]], ""]
(* Pick up random characters from the list *)
GeneratePassword[n_] := StringJoin[RandomSample[letters[], n]]
(* Generate password*)