Skip to content

Instantly share code, notes, and snippets.

View MayankPratap's full-sized avatar

Mayank Pratap Singh MayankPratap

  • Allahabad
View GitHub Profile
1
(up) / \ (up)
2 4
(down) \ / (up)
3
@MayankPratap
MayankPratap / imguru.py
Created April 29, 2017 18:43
random stuff
import requests
import json
import random
#import cStringIO
import base64
from base64 import b64encode
#import pyimgur
#import picamera
import pickle
from imgurpython import ImgurClient
import requests
import json
import random
#import cStringIO
import base64
from base64 import b64encode
#import pyimgur
#import picamera
import pickle
from imgurpython import ImgurClient
@MayankPratap
MayankPratap / app.py
Created May 1, 2017 08:50
Code that will send image to bot server.
import requests
import json
import random
import codecs
#import cStringIO
import base64
from base64 import b64encode
#import pyimgur
#import picamera
import pickle
@MayankPratap
MayankPratap / app.py
Created May 2, 2017 14:55
takes pic through picamera and sends to bot server
# This used Python simpleHTTPServer to host files and then tunnel using ngrok to get public ip
# Then i get url of images hosted on local server.
import requests
import json
import pickle
from time import sleep
@MayankPratap
MayankPratap / app.py
Last active May 15, 2017 11:44
runs on raspberry pi takes pic and sends it to bot server ( Currently picture capturing part is not shown)
# This used Python simpleHTTPServer to host files and then tunnel using ngrok to get public ip
# Then i get url of images hosted on local server.
import requests
import json
import pickle
from time import sleep
import requests
import json
url="http://elpisdesign.com/apply.php"
r=requests.options(url)
print(r.text)
@MayankPratap
MayankPratap / BotWarriors.cpp
Created May 19, 2017 12:04
Code for AI bot which got 2nd rank in CodeWarriors event in Avishkar 2k16.
#include<bits/stdc++.h>
using namespace std;
int dir[8][2] = { -1,-1 , -1,0 , -1,1 , 0,-1 , 0,1 , 1,-1 , 1,0 , 1,1 } ; // For direction
int x , y ; // x for amazon movement and y for arrow movement
int sx , sy , s; // selected amazon x and y location
int p , arena[15][15] , pos[3][5][3] , p1=1 , p2=1 , tmp[15][15] ;
int cons[40] = {100,65,48,40,36,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37} ;
/*
p for player selected
Verifying my Blockstack ID is secured with the address 1Mrn2R9Z8pmQbX2YGPfJSEFhmFSfoxPGhA https://explorer.blockstack.org/address/1Mrn2R9Z8pmQbX2YGPfJSEFhmFSfoxPGhA