Skip to content

Instantly share code, notes, and snippets.

View Adarshreddyash's full-sized avatar
:octocat:
Building Vuejs projects

Adarshreddy adelli Adarshreddyash

:octocat:
Building Vuejs projects
View GitHub Profile
@Adarshreddyash
Adarshreddyash / requirements.txt
Last active February 15, 2019 12:25
Programming API with python | gist for Gspace
pip install Flask
pip install requests
@Adarshreddyash
Adarshreddyash / Api_gspace_Final.py
Last active February 15, 2019 12:31
A gist that is a part of Api with python tutorial in Gspace | Adarshreddy adelli
from flask import Flask,jsonify,request
import json
import requests
app=Flask(__name__)
@app.route('/')
def ash(req):
mandi=requests.get('https://api.data.gov.in/resource/9ef84268-d588-465a-a308-a864a43d0070?api-key=579b464db66ec23bdd000001cdd3946e44ce4aad7209ff7b23ac571b&format=json&offset=0&limit=1')
mandi=json.loads(mandi)
#programming API in python | Gspace
from flask import Flask,jsonify,request
import pprint
import json
import requests
app=Flask(__name__)
@app.route('/')
def ash(req):
mandi=requests.get('https://api.data.gov.in/resource/9ef84268-d588-465a-a308-a864a43d0070?api-key=YOUR_API_KEY&format=json&offset=0&limit=1')
mandi=json.loads(mandi)
for item in mandi['records']:
response = """
state: {0}
[{'author': 'adarshreddy9849@gmail.com (Adarshreddy Adelli)',
'author_detail': {'email': 'noreply@blogger.com',
'name': 'Adarshreddy Adelli'},
'authors': [{'email': 'adarshreddy9849@gmail.com', 'name': 'Adarshreddy Adelli'}],
'gd_extendedproperty': {'name': 'commentModerationMode',
'value': 'FILTERED_POSTMOD'},
'guidislink': False,
'href': '',
'id': 'tag:blogger.com,1999:blog-6041987638358622721.post-8771612714219978308',
'link': 'https://glammingspace.blogspot.com/2019/05/tcav-its-time-to-enquiry-neural-network.html',
@Adarshreddyash
Adarshreddyash / night_mode.css
Created July 6, 2019 04:29
Adding Night mode to our website
$light-color: #eee;
body.dark-mode {
background-color: #485461;
background-image: linear-gradient(315deg, #485461 0%, #28313b 74%);
color: $light-color;
a {
color: #00000;
}
body::-webkit-scrollbar {
width: 9px;
}
body::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
}
body::-webkit-scrollbar-thumb {
background-color: #6b0f1a;
import socket
serversocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
serversocket.bind(('localhost', 5000))
serversocket.listen(5)
while True:
connection, address = serversocket.accept()
buffer = connection.recv(68)
if len(buffer) > 0:
print(buffer)
break
import socket
clientsocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
clientsocket.connect(('localhost', 5000))
clientsocket.send('Gspace is awesome')
import socket
HOST = socket.gethostbyname(socket.gethostname())
s = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_IP)
s.bind((HOST, 0))
s.setsockopt(socket.IPPROTO_IP, socket.IP_HDRINCL, 1)
s.ioctl(socket.SIO_RCVALL, socket.RCVALL_ON)
print(s.recvfrom(65565))
s.ioctl(socket.SIO_RCVALL, socket.RCVALL_OFF)