Skip to content

Instantly share code, notes, and snippets.

View armsp's full-sized avatar
👋

Shantam Raj armsp

👋
View GitHub Profile
@armsp
armsp / voice.py
Last active April 3, 2023 17:47
Identifying sentences with passive voices (english) using Spacy
import spacy
from spacy.matcher import Matcher
Active = "Harry ate six shrimp at dinner.\
Beautiful giraffes roam the savannah.\
Sue changed the flat tire.\
We are going to watch a movie tonight.\
I ran the obstacle course in record time.\
The crew paved the entire stretch of highway.\
Mom read the novel in one day.\
{
"title": "SECOND VARIETY",
"author": "PHILIP K. DICK",
"story": "The claws were bad enough in the first place—nasty, crawling little death-robots. But when they began to imitate their creators, it was time for the human race to make peace—if it could!\nThe Russian soldier made his way nervously up the ragged side of the hill, holding his gun ready. He glanced around him, licking his dry lips, his face set. From time to time he reached up a gloved hand and wiped perspiration from his neck, pushing down his coat collar.\nEric turned to Corporal Leone. “Want him? Or can I have him?” He adjusted the view sight so the Russian’s features squarely filled the glass, the lines cutting across his hard, somber features.\nLeone considered. The Russian was close, moving rapidly, almost running. “Don’t fire. Wait.” Leone tensed. “I don’t think we’re needed.”\nThe Russian increased his pace, kicking ash and piles of debris out of his way. He reached the top of the hill and stopped, panting, staring around him. The sk
@armsp
armsp / list.md
Last active August 20, 2020 05:52
Softwares
  • Foliate : EPUB Reader
  • Okular
  • Foxit PDF
  • Peek : Screencast GIFs
  • VSCode
  • Slack
  • Signal
  • Zoom
  • Spyder
  • VLC
@armsp
armsp / gdp.csv
Created August 10, 2020 13:37
GDP of countries in current USD taken from World Bank
Series Name Series Code Country Name Country Code 2019 [YR2019]
GDP per capita (current US$) NY.GDP.PCAP.CD Afghanistan AFG 502.115486913067
GDP per capita (current US$) NY.GDP.PCAP.CD Albania ALB 5352.85741103671
GDP per capita (current US$) NY.GDP.PCAP.CD Algeria DZA 3948.34327892571
GDP per capita (current US$) NY.GDP.PCAP.CD American Samoa ASM ..
GDP per capita (current US$) NY.GDP.PCAP.CD Andorra AND 40886.3911648431
GDP per capita (current US$) NY.GDP.PCAP.CD Angola AGO 2973.59115979868
GDP per capita (current US$) NY.GDP.PCAP.CD Antigua and Barbuda ATG 17790.309306815
GDP per capita (current US$) NY.GDP.PCAP.CD Argentina ARG 10006.1489736082
GDP per capita (current US$) NY.GDP.PCAP.CD Armenia ARM 4622.73349328671
@armsp
armsp / Class_File_Upload.py
Last active June 11, 2020 08:20
Upload files to flask restful server in two different ways. First is a proper upload and the other copies file from a given location to server's location by only providing the file path of file to copy in the URL itself.
import os
from flask import Flask, Response, request, jsonify, redirect, send_from_directory
from flask_restful import Api, Resource
from werkzeug.utils import secure_filename
class file_operation:
def __init__(self):
self.APP_ROOT = os.path.dirname(os.path.abspath(__file__))
self.UPLOAD_FOLDER = os.path.join(self.APP_ROOT, 'upload_folder_logreg')
self.ALLOWED_EXTENSIONS = set(['txt', 'csv'])
@armsp
armsp / fontawesome-github.svg
Last active March 5, 2020 17:22
Gist for seeing the difference in Chrome and Firefox renderings for a two.js project
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@armsp
armsp / Dockerfile
Created December 12, 2018 04:18
Gist containing simple Dockerfile and steps to run GUI from a docker container
#FROM python:3.7 ## Works with either of the base images. Size is larger with Python due to there being python2.7 too
FROM ubuntu:18.10
RUN apt-get update && apt-get upgrade -y
RUN apt-get install python3-dev python3-pip -y
RUN apt-get install python3-gi -y && \
apt-get install gir1.2-gtk-3.0 -y && \
apt-get install gir1.2-appindicator3-0.1 -y
@armsp
armsp / query.md
Last active February 8, 2020 11:46
GraphQL query to get user statistics like total followers, stargazers, watchers, issues, pull requests
query {
  user(login:"<any user name>"){               #Use "viewer" if you want to run it on your profile
    repositories(orderBy: {field: STARGAZERS, direction: DESC}){
      totalCount
    }
    followers{
      totalCount
    }
 issues_sum:issues{
@armsp
armsp / username@hostname.py
Created November 11, 2019 17:50
Generate cool <username>@<hostname> like Docker does using Python
import random
left = ["admiring",
"adoring",
"affectionate",
"agitated",
"amazing",
"angry",
"awesome",
"beautiful",
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.