Skip to content

Instantly share code, notes, and snippets.

View amitbhoraniya's full-sized avatar
🎯
Focusing

Amit Bhoraniya amitbhoraniya

🎯
Focusing
View GitHub Profile
@echo off
setlocal ENABLEDELAYEDEXPANSION
set JAVA_OPTS=
rem eol stops comments from being parsed
rem otherwise split lines at the = char into two tokens
for /F "eol=# delims== tokens=1,*" %%a in (test.properties) do (
rem proper lines have both a and b set
@echo off
setlocal enableextensions
:: search for available ports
call :findFirstAvailablePort 8080 tomcatPort
call :findFirstAvailablePort 1521 oraclePort
:: echo the retrieved data
echo Tomcat_port=%tomcatPort%
echo Oracle_port=%oraclePort%
def get_decorators(cls):
target = cls
decorators = {}
def visit_FunctionDef(node):
decorators[node.name] = []
for n in node.decorator_list:
name = ''
if isinstance(n, ast.Call):
name = n.func.attr if isinstance(n.func, ast.Attribute) else n.func.id
@amitbhoraniya
amitbhoraniya / download.py
Created November 30, 2016 04:40
Python Download
import sys, os, tempfile, logging,shutil
import urllib.request as urllib2
import urllib.parse as urlparse
import threading
import time
maxThreads = 64
block_sz = 16 * 1024
class FilePartThread(threading.Thread):