Skip to content

Instantly share code, notes, and snippets.

View Cartmanishere's full-sized avatar
💻

Pranav Gajjewar Cartmanishere

💻
View GitHub Profile
@Cartmanishere
Cartmanishere / squares.go
Created May 16, 2019 02:46
Calculate the sum of squares of positive numbers in golang without using for statement
package main
import (
"bufio"
"fmt"
"os"
"strconv"
"strings"
)
@Cartmanishere
Cartmanishere / continuous_perceptron.py
Last active November 21, 2020 11:44
Learning of a Continuous Perceptron as described in the book - 'Introduction to Artificial Neural Networks' by Jacek M. Zurada
"""
This is an implmentation of a Continuous Perceptron trained using Delta Learning Rule or Backpropagation.
It is based on the description of the same as given in the book -
'Introduction to Artificial Neural Networks' by Jackek M. Zurada
Date: July ‎16, ‎2018
Author: Pranav Gajjewar
Course: Artifical Neural Networks
The following work was done while studying as an undergraduate at SGGSIE&T, Nanded.
@Cartmanishere
Cartmanishere / nltk_service.proto
Created November 1, 2019 10:39
Protobuf definition file for grpc-python-golang example
syntax = "proto3";
message Request {
string text = 1;
}
message Response {
repeated string keywords = 1;
}
@Cartmanishere
Cartmanishere / server.py
Created November 1, 2019 10:43
Python server implementation for grpc-python-golang example
from nltk_service_pb2 import *
from nltk_service_pb2_grpc import *
import grpc
import nltk
from concurrent import futures
from nltk.corpus import stopwords
class NltkService(KeywordServiceServicer):
@Cartmanishere
Cartmanishere / server.py
Created November 1, 2019 10:47
Python server implementation for grpc-python-golang example
def serve(port):
server = grpc.server(futures.ThreadPoolExecutor(max_workers=10))
add_KeywordServiceServicer_to_server(
NltkService(), server)
server.add_insecure_port('[::]:' + str(port))
server.start()
print("Listening on port {}..".format(port))
try:
while True:
time.sleep(10000)
@Cartmanishere
Cartmanishere / command.sh
Created November 1, 2019 10:50
Command to generate language interface files for grpc-python-golang example
# For Python
python -m grpc_tools.protoc -I. --python_out=./python --grpc_python_out=./python nltk_service.proto
# For Golang
protoc -I. nltk_service.proto --go_out=plugins=grpc:golang
@Cartmanishere
Cartmanishere / client.go
Created November 1, 2019 10:55
Golang client for grpc-python-golang-example
package main
import (
"context"
"google.golang.org/grpc"
"fmt"
"bufio"
"os"
nltk "golang/nltk_service"
)
@Cartmanishere
Cartmanishere / client.go
Created November 1, 2019 10:58
Golang client for grpc-python-golang example
func main() {
client, err := InitGrpcConnection()
if err != nil {
fmt.Println(err)
os.Exit(0)
}
reader := bufio.NewReader(os.Stdin)
for {
@Cartmanishere
Cartmanishere / railwire.py
Last active October 16, 2021 05:16
Scrape data usage information from Railwire account using Python
#!/Users/pranav/.pyenv/shims/python
"""
Requirements:
- Python3
PIP Install:
- bs4
- requests
- lxml
What?
# Prevent Trackers and Malwares
https://raw.githubusercontent.com/DRSDavidSoft/additional-hosts/master/domains/blacklist/adservers-and-trackers.txt
https://gitlab.com/quidsup/notrack-blocklists/raw/master/notrack-malware.txt
https://gitlab.com/quidsup/notrack-blocklists/raw/master/notrack-blocklist.txt
https://raw.githubusercontent.com/notracking/hosts-blocklists/master/hostnames.txt
https://s3.amazonaws.com/lists.disconnect.me/simple_tracking.txt
https://gitlab.com/my-privacy-dns/matrix/matrix/-/raw/master/source/tracking/domains.list
https://raw.githubusercontent.com/r-a-y/mobile-hosts/master/AdguardApps.txt
https://raw.githubusercontent.com/r-a-y/mobile-hosts/master/AdguardMobileAds.txt
https://raw.githubusercontent.com/FadeMind/hosts.extras/master/StreamingAds/hosts