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
$(function () { | |
$('#jstree').on("select_node.jstree", function (e, data) { | |
switch (data.node.type) { | |
case "country": | |
alert("country"); | |
break; | |
case "region": | |
alert("region"); | |
break; |
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 random | |
# example data | |
#generate random set | |
x = [] | |
i = 1 | |
while i < 10000000: | |
l = random.sample(range(1, 60), 6) | |
str1 = '-'.join(str(e) for e in l) |
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
# Compiled source # | |
################### | |
*.com | |
*.class | |
*.dll | |
*.exe | |
*.o | |
*.so | |
# Packages # |
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 |
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
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: |
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 ' ' |
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
# Initialize the scroll | |
page = es.search( | |
index = 'yourIndex', | |
doc_type = 'yourType', | |
scroll = '2m', | |
search_type = 'scan', | |
size = 1000, | |
body = { | |
# Your query's body | |
}) |
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; |
OlderNewer