Skip to content

Instantly share code, notes, and snippets.


Hosein Shahmohammady Mhs-220

Block or report user

Report or block Mhs-220

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
Mhs-220 /
Last active Apr 3, 2019
Google TTS script for GoldenDict
import os
import sys
import json
import base64
user_input = ' '.join(sys.argv[1:])
# Payload that we should send to google api
payload = '{"input":{"text":"%s"},"voice":{"languageCode":"en-US","name":"en-US-Wavenet-D"},"audioConfig":{"audioEncoding":"LINEAR16","pitch":"0.00","speakingRate":"1.00"}}' % user_input
Mhs-220 /
Created Aug 27, 2018
Add order field to graphene django
import graphene
from graphene_django.filter import DjangoFilterConnectionField
class CustomDjangoFilterConnectionField(DjangoFilterConnectionField):
def connection_resolver(cls, resolver, connection, default_manager, max_limit,
enforce_first_or_last, filterset_class, filtering_args,
root, info, **args):
filter_kwargs = {k: v for k, v in args.items() if k in filtering_args}
qs = filterset_class(
Mhs-220 /
Created Aug 27, 2018
A simple handler for aws sns in marketplace for flask
@mod_auth.route('/handle_sns', methods = ['GET', 'POST', 'PUT'])
def handle_sns():
notification = json.loads(
notification_type = notification["Type"]
if notification_type == 'SubscriptionConfirmation':
if 'SubscribeURL' in notification:
url = notification['SubscribeURL']
print("Click for subscribe -> %s" % url)
# There is another state for unsubscribe confirmation,
You can’t perform that action at this time.