This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import locale | |
from math import log10 | |
def sexify(value): | |
""" | |
formats the float value to indian money format | |
:param value: | |
:return: | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import requests | |
from time import time | |
class OAuthClient: | |
def __init__(self, server, client_id, client_secret, grant_type, scope): | |
self.server = server | |
self.client_id = client_id | |
self.client_secret = client_secret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fetch = require('isomorphic-fetch'); | |
const { apiEndpoint } = require('./endpoint'); | |
const logger = require('./logger'); | |
// expected time for API service to respond | |
const RESPONSE_TIMEOUT = 2 * 60 * 1000; | |
const fetcher = (url, options = {}, mode = 'JSON') => { | |
const finalUrl = apiEndpoint + url; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Fragment } from 'react'; | |
import querystring from 'querystring'; | |
import PropTypes from 'prop-types'; | |
import getTheme from 'styles/getTheme'; | |
import { sanitizeCookies } from 'utils/utils'; | |
import { fetcher } from 'utils/apiCaller'; | |
import logger from 'utils/logger'; | |
import ErrorPage from './ErrorPage'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const fs = require('fs'); | |
const extract = require('extract-zip') | |
const formidable = require('formidable'); | |
const path = require('path'); | |
const uploadDir = path.join(__dirname, '/uploads/'); | |
const extractDir = path.join(__dirname, '/app/'); | |
if (!fs.existsSync(uploadDir)) { | |
fs.mkdirSync(uploadDir); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const fs = require('fs'); | |
const extract = require('extract-zip') | |
const formidable = require('formidable'); | |
const path = require('path'); | |
const uploadDir = path.join(__dirname, '/uploads/'); | |
const extractDir = path.join(__dirname, '/app/'); | |
if (!fs.existsSync(uploadDir)) { | |
fs.mkdirSync(uploadDir); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import base64 | |
import urllib | |
MAILGUN_API_URL = "<api-url>" | |
MAILGUN_API_TOKEN = "<api-token>" | |
def send_mail(from_email, to_email, subject, message): | |
data = urllib.parse.urlencode({ | |
"from": from_email, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import SimpleHTTPServer | |
from SimpleHTTPServer import SimpleHTTPRequestHandler | |
class RangeHTTPRequestHandler(SimpleHTTPRequestHandler): | |
"""RangeHTTPRequestHandler is a SimpleHTTPRequestHandler | |
with HTTP 'Range' support""" | |
def send_head(self): | |
"""Common code for GET and HEAD commands. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const https = require('https'); | |
const qs = require('querystring'); | |
const MAILGUN_API_TOKEN = '<api-token>'; | |
const MAILGUN_API_PATH = '<api-path>'; // API url without hostname | |
const MAILGUN_FROM_EMAIL = '<[email protected]>'; | |
const options = { | |
hostname: 'api.mailgun.net', | |
path: MAILGUN_API_PATH, |
OlderNewer