Skip to content

Instantly share code, notes, and snippets.

View anuj9196's full-sized avatar
🎯
Focusing

Anuj Sharma anuj9196

🎯
Focusing
View GitHub Profile
@anuj9196
anuj9196 / anagram.py
Last active August 11, 2018 07:11
Program to count number of items to be deleted to make two strings anagrams.
"""
Given two strings, a and b, that may or may not be of same length,
determine the minimum number of character deletions required to make a and b anagrams.
Any characters can be deleted from either of the strings
NOTE: Anagram of a word is formed by arranging the letters of the word.
For eg. -> for the word RAM: RAM, AMR, MAR, etc are the anagrams
"""
attempts = int(input())
@anuj9196
anuj9196 / django_country_fixture.py
Created June 6, 2018 02:24
Django country fixture data
# Generated by Django 2.0.5 on 2018-05-28 17:20
from django.db import migrations
def create_countries(apps, schema_editor):
Country = apps.get_model('address', 'Country')
db_alias = schema_editor.connection.alias
Country.objects.using(db_alias).bulk_create([
Country(name='Afghanistan', code='AF', isd_code=93, currency_name='Afghan afghani', currency_code='AFN',
@anuj9196
anuj9196 / captcha solve
Last active May 23, 2018 07:32
captcha solving error
# my function to solve the captcha
# here I'm passing the url of the image with captcha_image
# the url example: https://images-na.ssl-images-amazon.com/captcha/sargzmyv/Captcha_xhoxwckkdo.jpg
```
def solve_captcha(captcha_image):
print('--- called solve_captcha for captcha: '+str(captcha_image))
print('--- setting Death By Captcha credentials---')
client = deathbycaptcha.SocketClient('vega6dev', 'dev@1234')
@anuj9196
anuj9196 / getphoto_response.json
Created November 23, 2017 07:44
getphoto response
{
"status": "OK",
"result": {
"keyword": "cars",
"page": "3",
"result": [
{
"status": true,
"network": "flickr",
"count": 10,