This file contains hidden or 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
| (ns nurture-clj.middleware.exception-handler | |
| (:require [clj-http.client :as client] | |
| [cheshire.core :refer [generate-string]] | |
| [config.core :refer [env]] | |
| [nurture-clj.log :as log] | |
| [clojure.string :as str] | |
| [schema.utils :as sc] | |
| [config.core :refer [env]] | |
| [ring.util.http-response :as respond])) |
This file contains hidden or 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
| ;; Create random string in clojure | |
| (defn rand-str [len] | |
| (apply str (take len (repeatedly #(char (+ (rand 26) 97)))))) | |
| ;small | |
| (defn rand-strB [len] | |
| (apply str (take len (repeatedly #(char (+ (rand 26) 65)))))) | |
| ;caps | |
This file contains hidden or 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 uuid | |
| from flask import Flask | |
| from flask import request | |
| UPLOAD_FOLDER = 'uploads/' | |
| ALLOWED_EXTENSION = set (['Pdf', 'docx']) | |
| app = Flask(__name__) | |
| app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER |
This file contains hidden or 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 itertools | |
| def xpath_soup(element): | |
| """ | |
| Generate xpath of soup element | |
| :param element: bs4 text or node | |
| :return: xpath as string | |
| """ | |
| components = [] | |
| child = element if element.name else element.parent |
This file contains hidden or 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
| # -*- coding: utf-8 -*- | |
| # filename: crawler.py | |
| # Author: Indrajith Indraprastahm | |
| # Lisence: GPL v3: http://www.gnu.org/licenses/ | |
| #-------------------------------------------------------------------------------- | |
| # README | |
| #-------------------------------------------------------------------------------- | |
| # Install Requirements | |
| # pip install validators beautifulsoup4 lxml |
This file contains hidden or 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 glob | |
| import subprocess | |
| for file in glob.glob('*.mp4'): | |
| out = file[:len(file)-3]+"mp3" | |
| proc = subprocess.Popen(["ffmpeg","-i",file,out,"-y"], stdout=subprocess.PIPE) | |
This file contains hidden or 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
| #Sat Feb 11 02:27:07 IST 2017 | |
| #Indrajith Indraprastham | |
| from subprocess import call | |
| import os | |
| from os import listdir | |
| from os.path import isfile, join | |
| #get current directory path | |
| mypath = os.getcwd() |
This file contains hidden or 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
| alert("success"); |
This file contains hidden or 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
| //Sunday 06 September 2015 10:56:37 PM IST | |
| //Programmer: Indrajith indraprastham | |
| // Other link: http://hostcode.sourceforge.net/view/3332 | |
| /*............... Question ................... | |
| Chef has just started Programming, he is in first year of Engineering. Chef is reading about Relational Operators. | |
| Relational Operators are operators which check relatioship between two values. Given two numerical values A and B you need to help chef in finding the relationship between them that is, | |
| First one is greater than second or, |
This file contains hidden or 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
| // Lex Program to check the entered arithmetic operation is valid or not | |
| // Programmer: Indrajith Indraprastham | |
| // Date : 19 AUG 2015 ; 1:34 | |
| // Note: | |
| // Final expr with (a+b)*(a-b): ^({op1})({op1}?{op2}{op1}{op1}?)*{op2}?{op1}$ | |
| // Final expr with (a+b)(a-b) : ^({op1})({op1}*{op2}{op1}{op1}*)*{op2}?{op1}$ | |
| // ^({op1} : starts with op1; | |
| // ({op1}*{op2}{op1}{op1}*)* : matches a+b+c+d | |
| // {op2}?{op1}$ : ends expr with op1 |