Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# code based on https://mail.python.org/pipermail/python-list/2015-November/698551.html | |
def find_pst_folder(mapi, pst_filepath): | |
dispatch = win32com.client.gencache.EnsureDispatch | |
for store in dispatch(mapi.Stores): | |
if store.IsDataFileStore and store.FilePath == pst_filepath: | |
return store.GetRootFolder() | |
def get_pst_folder(pst_filepath): |
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
select distinct * | |
from all_dependencies a | |
start with a.referenced_name = 'TEST' | |
connect by NOCYCLE prior a.name = a.referenced_name; |
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
# Initialize the scroll | |
page = es.search( | |
index = 'yourIndex', | |
doc_type = 'yourType', | |
scroll = '2m', | |
search_type = 'scan', | |
size = 1000, | |
body = { | |
# Your query's body | |
}) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# shortform git commands | |
alias g='git' | |
# git commit random alias | |
git config --global alias.commit-random '!git commit -m "$(curl -s http://whatthecommit.com/index.txt)"' | |
usage: git commit-random | |
# get list of users public repos | |
curl "https://api.github.com/users/usernamehere/repos?type=owner&sort=updated" -s | sed -En 's|"name": "(.+)",|\1|p' | tr -d ' ' |
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 sys, os, time, csv | |
data_dir = os.path.join(os.getcwd(), os.pardir, 'data') | |
sys.path.append(data_dir) | |
with open(os.path.join(data_dir, "listing.csv"), 'w') as csvfile: | |
writer = csv.writer(csvfile) | |
row = ('path', 'modified_date', 'last_accesed_date', 'size') | |
writer.writerow(row) | |
for root, directories, filenames in os.walk('c:\\temp\\'): | |
for filename in filenames: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# how can i exclude None values ? | |
#get minimum and maximum stock options | |
result = min(data_dict.values(), key=lambda v:v['exercised_stock_options'] if v['exercised_stock_options'] != 'NaN' else float('inf')) | |
print result | |
result = max(data_dict.values(), key=lambda v:v['exercised_stock_options'] if v['exercised_stock_options'] != 'NaN' else float('-inf')) | |
print result |
NewerOlder