Skip to content

Instantly share code, notes, and snippets.

View gugu's full-sized avatar
🇺🇦

Andrii Kostenko gugu

🇺🇦
View GitHub Profile
{
"type": "Topology",
"arcs": [
[
[16814, 15074],
[71, -45],
[53, 16],
[15, 54],
[55, 18],
[39, 37],
@gugu
gugu / features.json
Last active March 18, 2021 17:08
short.io features
{
"paidFeatures":{"users":{"title":"Users","tooltip":"The number of users included in the plan.","tiny":"1","small":"1","standard":"unlimited","large":"unlimited"},"domains":{"title":"Custom domains","tooltip":"The number of custom domains you can use to create branded links. Domain name registration fees are not included in the plan cost.","tiny":"5","small":"10","standard":"50","large":"unlimited"},"links":{"title":"Branded links total","tooltip":"The number of branded links you can create and redirect to the destination URL. Limits are issued once and can be used over the account lifetime.","tiny":"1,000","small":"10,000","standard":"100,000","large":"unlimited"},"redirects":{"title":"Redirects","tooltip":"The number of visitors redirected from a branded link to the destination URL.","tiny":"unlimited","small":"unlimited","standard":"unlimited","large":"unlimited"},"tracked":{"title":"Tracked clicks","tooltip":"The limit of redirects visible in statistics (countries, devices, languages, time chart and mo
export async function verifyCaptcha(captchaToken: string) {
try {
const verifyResponse = await got.post('https://www.google.com/recaptcha/api/siteverify', {
body: {
response: captchaToken,
secret: process.env.RECAPTCHA_SECRET,
},
form: true,
json: true,
});
@gugu
gugu / api.md
Last active April 21, 2019 19:49
Short.cm Enterprise API
@gugu
gugu / index.html
Created October 10, 2018 09:50
wYJNRy
<html>
<body>
<object data="https://www.gravatar.com/avatar/00000000000000000000000000000000?d=https%3A%2F%2Fexample.com%2Fimages%2Favatar.jpg" type="image/png">
test
</object>
</body>
</html>
@gugu
gugu / slowlog.sql
Created June 22, 2018 16:06
Slow log UI
SELECT q, COUNT(*) AS c, avg(query_time) as avg_query, avg(lock_time), COUNT(*) * AVG(query_time) as total_time
FROM (
SELECT regexp_replace(regexp_replace(regexp_replace(sql_text, "'.*?'", '?'), 'IN \\(.*?\\)', 'IN ?'), '\\d+', '?') as q, query_time, lock_time from mysql.slow_log
WHERE DATEDIFF(start_time, NOW()) < 30
) a
GROUP by q
ORDER BY total_time DESC
LIMIT 10;
@gugu
gugu / slow.py
Created December 19, 2017 04:56
# Возвращаем элементы первого массива, которые есть во втором
import random
import time
def intersection_with_loops(first_array, second_array):
result = []
for first_element in first_array:
if first_element in second_array:
result.append(first_element)
return result
{
"totalClicks": 115,
"humanClicks": 0,
"clickStatistics": {
"labels": [
"Mar'17",
"Apr'17",
"May'17",
"Jun'17",
"Jul'17",
### Keybase proof
I hereby claim:
* I am gugu on github.
* I am kostenko (https://keybase.io/kostenko) on keybase.
* I have a public key ASBH4UFBHP2QbipSiuKorkmPKt7NBhzyt2WhGiulCn-kGAo
To claim this, I am signing this object:
# To reproduce issue, call tasks.leak_channels.delay().get()
from celery import Celery, chord
app = Celery('tasks', broker='pyamqp://guest@localhost//', backend='redis://127.0.0.1/')
@app.task
def add(x, y):
return x + y
@app.task