Skip to content

Instantly share code, notes, and snippets.

View sileht's full-sized avatar

Mehdi ABAAKOUK sileht

View GitHub Profile
@sileht
sileht / gist:d2dccaaae59777b111a40c22568201a1
Last active March 13, 2024 19:06
Mergify tampermonkey extension
// ==UserScript==
// @name Mergify
// @namespace http://tampermonkey.net/
// @version 2024-03-13
// @description try to take over the world!
// @author Mehdi Abaakouk<sileht@mergify.com>
// @match https://github.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=mergify.com
// @grant none
// ==/UserScript==
@sileht
sileht / dict-comprenhension-await.py
Created September 24, 2021 07:38
dict-comprenhension-await.py
import asyncio
async def compute(i):
await asyncio.sleep(0)
return i + 1
async def main():
items = ["a", "b", "c"]
queue_rules:
- name: bypass
conditions:
- check-success: foobar
method: rebase
- name: main
conditions:
- approved: 1
- check-success: foobar
pull_request_rules:
- name: common ci requirements
conditions:
- status-success=foobar
- status-success=otherci
- status-success=circle-ci
actions:
check-runs:
title: common-ci-requirements
@sileht
sileht / auto-tidy.sh
Last active September 15, 2020 13:02
#!/bin/bash
set -e
set -o pipefail
format_file() {
file="${1}"
[ ${file#src/} == ${file} -a ${file#tests/} == ${file} ] && return # don't startswith src/ or tests
[ ${file#src/ext} != ${file} ] && return # startswith src/ext
import os
import redbaron
import sys
def fixup_test(test):
if not test.arguments:
return
trinary_operations = {
u"clip": numpy.clip,
}
def handle_binary_operator(nodes, granularity, timestamps,
initial_values, is_aggregated, references):
op = nodes[0]
g1, t1, v1, is_a1 = evaluate(nodes[1], granularity, timestamps,
initial_values, is_aggregated, references)
g2, t2, v2, is_a2 = evaluate(nodes[2], granularity, timestamps,
@sileht
sileht / tmux-sixel-2.5-2\~bpo9+1.patch
Last active December 5, 2022 23:12
sixel support for tmux-2.5-2\~bpo9+1
commit b4a5392a631ca08893c7b5653756bc1aa21db71b
Author: Mehdi Abaakouk <sileht@sileht.net>
Committer: Mehdi Abaakouk <sileht@sileht.net>
Date: Fri Oct 6 10:16:01 2017 (43 seconds ago)
sixel patch
Updated from https://github.com/saitoha/tmux-SIXEL
for debian strech
diff --git a/gnocchi/tests/test_carbonara.py b/gnocchi/tests/test_carbonara.py
index 51cbfc22..3b2c4743 100644
--- a/gnocchi/tests/test_carbonara.py
+++ b/gnocchi/tests/test_carbonara.py
@@ -276,6 +276,46 @@ class TestAggregatedTimeSerie(base.BaseTestCase):
self.assertEqual(5.9000000000000004,
ts[datetime64(2014, 1, 1, 12, 0, 0)][1])
+ def test_mean_bug_percentile(self):
+ for i in range(0, 1000000):
@sileht
sileht / test-pytimeparse.py
Last active August 29, 2017 18:30
test-pytimeparse
import timeit
print("https://github.com/wroberts/pytimeparse/pull/14")
values = ["-%s seconds" % i for i in xrange(10)]
valuesbig = ["-%s seconds" % i for i in xrange(100)]
valuesbigger = ["-%s seconds" % i for i in xrange(1000)]
for v in ["values", "valuesbig", "valuesbigger"]: