Skip to content

Instantly share code, notes, and snippets.

View sadikkuzu's full-sized avatar

SADIK KUZU sadikkuzu

View GitHub Profile
@sadikkuzu
sadikkuzu / happy_numbers.py
Created September 23, 2018 17:52
Exploring happy numbers
# 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):
@sadikkuzu
sadikkuzu / JiraCloudOutage.html
Created September 26, 2018 08:36
Jira Cloud outage - 9/26/18
<!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
@sadikkuzu
sadikkuzu / JiraCloudOutage.txt
Created September 26, 2018 08:37
Jira Cloud outage - 9/26/18
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.
@sadikkuzu
sadikkuzu / Jekyll_tags_by_name.html
Created June 19, 2019 13:02
Jekyll Liquid site.tags
{% capture site_tags %}{% for tag in site.tags %}{{ tag | first | downcase }}#{{ tag | first }}{% unless forloop.last %},{% endunless %}{% endfor %}{% endcapture %}
{% assign tag_hashes = site_tags | split:',' | sort %}
<ul class="list-group">
{% for hash in tag_hashes %}
{% assign keyValue = hash | split: '#' %}
{% capture tag_word %}{{ keyValue[1] | strip_newlines }}{% endcapture %}
<li class="list-group-item">
<a href="/tags/{{ tag_word }}">
{{ tag_word }}
<span class="badge pull-right">{{ site.tags[tag_word].size }}</span>
@sadikkuzu
sadikkuzu / fix.sh
Last active November 1, 2019 01:27
U18D
#!/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
@sadikkuzu
sadikkuzu / review.js
Created January 22, 2020 17:06
Review pull request changes, view'em all, and submit.
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();
find . | sed -e "s/[^-][^\/]*\// |/g" -e "s/|\([^ ]\)/|-\1/"
@sadikkuzu
sadikkuzu / flatten.py
Last active March 24, 2021 22:08
Juggle with lists
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]]]))