Skip to content

Instantly share code, notes, and snippets.

View nickedes's full-sized avatar

Nikhil Mittal nickedes

  • Bangalore, India
View GitHub Profile
@nickedes
nickedes / x.py
Created September 21, 2014 14:20
import requests
from bs4 import BeautifulSoup
import hashlib
def getPic(search):
#replace spaces by %20 for searching
search = search.replace(" ","%20")
url = "https://www.google.com/search?site=imghp&tbm=isch&source=hp&biw=1414&bih=709&q="+search+"&oq="+search
@nickedes
nickedes / extract.py
Last active August 29, 2015 14:07
extract links from a chat
import json
from pprint import pprint
import re
with open('complete.pretty.json') as data_file:
data = json.load(data_file)
for i in range(0, len(data)):
url = data[i]['body']
if (re.findall('http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+', url) ):
print data[i]['author']
import requests
from bs4 import BeautifulSoup
import os
import urllib
def getPic():
@nickedes
nickedes / Recommend.md
Created December 6, 2014 04:26
Recommender #ideabin #recommended #idea

Create an app that recommends me things(just an idea) based on my full activity being tracked on Manic Time. Using various Machine learning algos.

@nickedes
nickedes / python-pip3-log.md
Last active August 29, 2015 14:15
Error in pip3
nickedes@nickedes ~> sudo apt-get purge python-setuptools python3-setuptools python-pip python3-pip
[sudo] password for nickedes: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'python-pip' is not installed, so not removed
The following packages were automatically installed and are no longer required:
  gir1.2-nemo-3.0 libboost-python1.54.0 libcryptui0a libgtksourceview2.0-0
  libgtksourceview2.0-common libjs-jquery libjs-sphinxdoc libjs-underscore
➜ apertium ./autogen.sh 
libtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.ac and
libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
configure.ac:53: warning: AM_INIT_AUTOMAKE: two- and three-arguments forms are deprecated.  For more info, see:
configure.ac:53: http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_005fINIT_005fAUTOMAKE-invocation
apertium/Makefile.am:164: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
@nickedes
nickedes / client.py
Last active August 29, 2015 14:17 — forked from dufferzafar/client.py
import sys
from socket import socket, AF_INET, SOCK_DGRAM
SERVER_IP = '127.0.0.1'
PORT_NUMBER = 5000
SIZE = 1024
print("Test client sending packets to IP {0}, via port {1}\n".format(SERVER_IP, PORT_NUMBER))
mySocket = socket(AF_INET, SOCK_DGRAM)
@nickedes
nickedes / call-steps
Last active September 15, 2015 17:27
Download 3.14.37.tar.xz
STEP 1:
cd Downloads/
sudo tar -xvJf linux-3.14.37.tar.xz -C /usr/src/
cd /usr/src/linux-3.14.37/
sudo mkdir hello
cd hello/
sudo gedit hello.c #given below