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 sys | |
| class global_flag(object): | |
| def __init__(self): | |
| self.flag_value = False | |
| def get(self): | |
| return self.flag_value | |
| def change(self): | |
| self.flag_value = not self.flag_value |
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
| #!/bin/env python | |
| # -*- coding: utf-8 -*- | |
| from __future__ import division | |
| from threading import Thread | |
| import subprocess | |
| import psutil | |
| import time | |
| import os |
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 -*- | |
| from bs4 import BeautifulSoup | |
| import requests | |
| import json | |
| def get_html(url , data = None): | |
| r = requests.get(url, timeout=10) |
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 -*- | |
| from bs4 import BeautifulSoup | |
| import requests | |
| def get_html(url , data = None): | |
| r = requests.get(url, timeout=10) |
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
| #!/bin/env python | |
| # -*- coding: utf-8 -*- | |
| from selenium import webdriver | |
| from selenium.webdriver.common.by import By | |
| from selenium.webdriver.common.action_chains import ActionChains | |
| from PIL import Image | |
| import numpy as np | |
| import time | |
| import cv2 |
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
| #!/bin/env python | |
| # -*- coding:utf-8 -*- | |
| import time | |
| from selenium import webdriver | |
| from selenium.webdriver.common.by import By | |
| from bs4 import BeautifulSoup | |
| driver = webdriver.Chrome() | |
| WAIT_TIME = 30 |
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
| #!/bin/env python | |
| # -*- coding:utf-8 -*- | |
| from selenium import webdriver | |
| from selenium.webdriver.common.by import By | |
| from selenium.webdriver.chrome.options import Options | |
| from bs4 import BeautifulSoup | |
| import time | |
| presets = [ | |
| {"key":"1080 x 1920","name":"Nexus 5 Portrait","width":1080,"height":1920}, |
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
| #modify ~/.profile | |
| alias sudo='sudo env PATH=$PATH:$NVM_BIN' |
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
| a:link,a:visited{ | |
| font-weight: bold; | |
| color: darkgray; | |
| text-align: center; | |
| padding: 6px; | |
| text-decoration: none; | |
| } | |
| a:hover,a:active{ | |
| color: dimgray; | |
| } |
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 duplicate_count(s): | |
| return len([c for c in set(s.lower()) if s.lower().count(c)>1]) | |
| #test.assert_equals(duplicate_count("abcde"), 0) | |
| #test.assert_equals(duplicate_count(""), 0) | |
| #test.assert_equals(duplicate_count("abcdea"), 1) | |
| #test.assert_equals(duplicate_count("indivisibility"), 1) | |
| #test.assert_equals(duplicate_count("aabbcde"), 2) | |
| #test.assert_equals(duplicate_count("aabbcdeB"), 2) | |
| #test.assert_equals(duplicate_count("Indivisibilities"), 2) |