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
def flatten(list_of_lists): | |
if len(list_of_lists) == 0: | |
return list_of_lists | |
if isinstance(list_of_lists[0], list): | |
return flatten(list_of_lists[0]) + flatten(list_of_lists[1:]) | |
return list_of_lists[:1] + flatten(list_of_lists[1:]) | |
print(flatten([[1, 2, 3, 4], [5, 6, 7], [8, 9], [[10]]])) |
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
find . | sed -e "s/[^-][^\/]*\// |/g" -e "s/|\([^ ]\)/|-\1/" |
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
var els = document.getElementsByClassName('js-reviewed-checkbox') | |
Array.prototype.forEach.call(els, function(el) { el.click() }); | |
document.getElementsByName('pull_request_review[event]')[1].click() | |
document.getElementsByClassName('btn btn-sm btn-primary float-left mr-1')[0].click(); |
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
#!/usr/bin/env sh | |
cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf - | |
apt install libqt5gui5 -y | |
sudo wget -O /usr/local/bin/dropbox "https://www.dropbox.com/download?dl=packages/dropbox.py" | |
sudo chmod +x /usr/local/bin/dropbox | |
dropbox status | |
echo dropbox start |
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
HTTP Status 500 – Internal Server Error | |
Type Exception Report | |
Message TenantContextCommand short-circuited and fallback disabled. | |
Description The server encountered an unexpected condition that prevented it from fulfilling the request. | |
Exception | |
com.netflix.hystrix.exception.HystrixRuntimeException: TenantContextCommand short-circuited and fallback disabled. |
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
<!doctype html><html lang="en"><head><title>HTTP Status 500 – Internal Server Error</title><style type="text/css">h1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} h2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} h3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} body {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} b {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} p {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;} a {color:black;} a.name {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 500 – Internal Server Error</h1><hr class="line" /><p><b>Type</b> Exception Report</p><p><b>Message</b> TenantContextCommand short-circuited and fallback disabled.</p><p><b>Description</b> The server encountered an unexpected condition that prevented it |
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
# https://www.wikiwand.com/en/Happy_number | |
# http://mathworld.wolfram.com/HappyNumber.html | |
def square(x): | |
return int(x) * int(x) | |
def happy(number): | |
return sum(map(square, list(str(number)))) | |
def is_happy(number): |