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
package service; | |
import com.fasterxml.jackson.core.type.TypeReference; | |
import com.fasterxml.jackson.databind.ObjectMapper; | |
import lombok.Getter; | |
import lombok.Setter; | |
import org.springframework.core.NestedRuntimeException; | |
import org.springframework.core.ParameterizedTypeReference; | |
import org.springframework.http.*; | |
import org.springframework.http.client.ClientHttpResponse; |
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
package com.experimental.b; | |
import org.testng.ITest; | |
import org.testng.annotations.*; | |
import org.testng.xml.XmlTest; | |
@Listeners({SomeTestListener.class}) | |
public class SomeFactoryTest implements ITest{ | |
private int id; | |
private String name = "unknown"; |
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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import urllib2 | |
import json | |
import base64 | |
class TestRailAPIError(Exception): |
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
def get_all_file_paths(root_path): | |
paths = [] | |
for item in os.listdir(root_path): | |
full_path = os.path.join(root_path, item) | |
if os.path.isfile(full_path): | |
paths.append(full_path) | |
else: | |
paths.extend(get_all_file_paths(full_path)) | |
return paths |
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 datetime | |
import time | |
def timestamp_from_date(year, month, day, hour, minutes, seconds): | |
t = datetime.datetime(year, month, day, hour, minutes, seconds).timetuple() | |
return time.mktime(t) | |
def date_from_utc_timestamp(timestamp): | |
# about date string formatting: http://strftime.org/ | |
return datetime.datetime.utcfromtimestamp(timestamp).strftime('%b %d, %Y %I:%M %p') # 'Apr 18, 2015 06:04 AM' |
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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import csv | |
# The following module can be found here: http://dev.mysql.com/downloads/connector/python/ | |
# or installed via aptitude (Debian/Ubuntu): aptitude install python-mysql.connector | |
import mysql.connector |
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
#!/usr/bin/env python2 | |
# coding: utf-8 | |
import os,socket,threading,time | |
#import traceback | |
allow_delete = False | |
local_ip = socket.gethostbyname(socket.gethostname()) | |
local_port = 8888 | |
currdir=os.path.abspath('.') |
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
"""Module's functions allow convert Python dictionary to object. | |
""" | |
def dict2obj(pydict): | |
"""Converts dictionaries into objects that allow names | |
to be accessed as attributes as well as items. | |
""" | |
class container(object): |
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 -*- | |
import csv | |
fp = open('oui.txt', 'rb') | |
entries = [{'oui_hex': 'oui_hex', | |
'oui_base16': 'oui_base16', | |
'lower_mac_bound': 'lower_mac_bound', | |
'upper_mac_bound': 'upper_mac_bound', |