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
/* | |
* Copyright (c) 2015 Neeraj Sharma. All rights reserved. | |
* | |
* Licensed under GNU GPL v3 License. | |
* License: https://www.gnu.org/licenses/gpl-3.0.txt | |
* | |
* Code style based on the Linux Kernel, see | |
* https://www.kernel.org/doc/Documentation/CodingStyle | |
* for more details. | |
* |
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
/* | |
* Copyright (c) 2015 Neeraj Sharma. All rights reserved. | |
* | |
* This program is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation, either version 3 of the License, or | |
* (at your option) any later version. | |
* | |
* This program is distributed in the hope that it will be useful, | |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
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: Neeraj Sharma | |
# | |
# https://www.graphengine.io/docs/manual/index.html | |
# https://www.microsoft.com/net/learn/get-started/linux/ubuntu16-04 | |
setup_dot_net() { | |
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg | |
sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg | |
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-xenial-prod xenial main" > /etc/apt/sources.list.d/dotnetdev.list' |
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
#!python | |
from pymongo import MongoClient | |
import pandas as pd | |
from datetime import datetime | |
from datetime import timedelta | |
import requests | |
import sys | |
import json |
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
#!erlang | |
%% @doc Fetch content from internet and summarize | |
%% @author Neeraj Sharma | |
%% | |
%% run web_retrieve_url_and_summarize(<<"http://beamparticle.org/about.html">>, 5000, 5000) | |
%% | |
fun(Url, ConnectTimeoutMsec, TimeoutMsec) when (is_binary(Url) orelse is_list(Url)) | |
andalso is_integer(ConnectTimeoutMsec) | |
andalso is_integer(TimeoutMsec) -> | |
Headers = [], |
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
#!python | |
# | |
# py_text_readability | |
# | |
# see https://github.com/buriy/python-readability#python-readability | |
# | |
# Dependencies: | |
# | |
# sudo pip3 install readability-lxml | |
# |
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
#!python | |
# Sample Python 3 function to return what was passed in as the first argument. | |
# Notice that this template works for the /post/<thisfun> interface, where | |
# json input is passed in the first argument postBody, while the response | |
# is a binary or a string, which must be json as well. | |
from Pyrlang import term | |
import json | |
def main(data_binary, context_binary): |
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
#!elixir | |
# Sample Python 3 function to return what was passed in as the first argument. | |
# Notice that this template works for the /post/<thisfun> interface, where | |
# json input is passed in the first argument postBody, while the response | |
# is a binary or a string, which must be json as well. | |
fn (body, context) -> | |
decoded_map = :jiffy.decode(body, [:return_maps]) | |
# TODO process decoded_map | |
result = decoded_map |
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
#!efene | |
#_ "A sample efene code to return what was passed in as the first argument." | |
#_ "Notice that this template works for the /post/<thisfun> interface, where" | |
#_ "json input is passed in the first argument postBody, while the response" | |
#_ "is a binary or a string, which must be json as well." | |
#_ "" | |
#_ "Read about Efene at efene.org" | |
#_ "see http://efene.org/language-introduction.html" | |
#_ "" | |
#_ "Author: Neeraj Sharma <neeraj.sharma@alumni.iitg.ernet.in>" |
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
#!erlang | |
%% Sample Erlang (OTP-20) function to return what was passed in as the first argument. | |
%% Notice that this template works for the /post/<thisfun> interface, where | |
%% json input is passed in the first argument postBody, while the response | |
%% is a binary or a string, which must be json as well. | |
fun (Body, Context) -> | |
DecodedMap = jiffy:decode(Body, [return_maps]), | |
%% TODO process decoded_map | |
Result = DecodedMap, |