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
(defun etc-maybe-recenter () | |
(unless (or | |
;; don't interfere with erc scroll-to-bottom | |
(derived-mode-p 'erc-mode 'term-mode 'shell-mode 'eshell-mode) | |
(not (eq (get-buffer-window (current-buffer) t) (selected-window))) | |
(equal (window-point) (point-max)) | |
(region-active-p) | |
) | |
(recenter))) |
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
#include <stdint.h> | |
#include <stdio.h> | |
#include <stddef.h> | |
typedef void (*test_function_t)(); | |
// Why is `__attribute__((aligned(16)))` necessary? With the default | |
// alignment of 8, we print a large negative value for limit and then | |
// don't print any `a` fields. | |
struct __attribute__((aligned(16))) foo |
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 python | |
# -*- coding: utf-8 -*- | |
import asyncio | |
import random | |
import logging as log # noqa | |
from typing import TypeVar, Generator | |
import pytest | |
_T = TypeVar("_T") |
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 asyncio | |
import signal | |
import logging as log | |
def cancel_all_tasks(loop: asyncio.AbstractEventLoop) -> None: | |
log.info("SIGINT received, cancelling tasks...") | |
tasks = asyncio.all_tasks(loop) | |
for task in asyncio.all_tasks(loop): | |
task.cancel() |
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 python | |
# -*- coding: utf-8 -*- | |
import asyncio | |
from asyncio import Task | |
import contextvars | |
from typing import Any, Coroutine, TypeVar | |
T = TypeVar("T") |
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
$ cut -d'(' -f 1 /tmp/log | grep -av attached | grep -aoE '\] [a-zA-Z0-9]+' | sort | uniq -c | |
4 ] accept4 | |
18 ] chmod | |
194 ] clone | |
427 ] close | |
50 ] epoll | |
192 ] exit | |
12 ] fcntl | |
413 ] fstat | |
35636 ] futex |
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
#![allow(dead_code)] | |
struct A { | |
data: i32, | |
} | |
struct B { | |
data: i32, | |
} |
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
(defun mouse-button-pressed-p () | |
"Return non-nil if last event is a mouse-button down event." | |
(run-hooks 'mouse-leave-buffer-hook) | |
(and (consp last-input-event) | |
(string-match-p "down-mouse-" (format "%s" (car last-input-event))))) | |
(defun etc-maybe-recenter () | |
(unless (or | |
;; don't interfere with erc scroll-to-bottom |
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
(wrong-type-argument char-or-string-p [nil 22077 4073 787364 1 etc-clear-truncate-timer (#<buffer $shell<5>>) nil 553000]) | |
helm-mm-exact-match([nil 22077 4073 787364 1 etc-clear-truncate-timer (#<buffer $shell<5>>) nil 553000]) | |
#[0 "\300\211\205\215 \211@\307\"\204\206 \310!\305\301\203 \301!\202 !\203\205 \307\"\204\205 \311\303\236\2047 \312\313#\210\314\315\303\"\211\203k \211<\203f \316!\204f \211\317:\203a @\262\211!\262A\262\202L \266\202k \211!\262\210\306\306\242B\240\210\304\211\242T\240\210\304\242\302U\203\205 \320\321\317\"\210\210A\266\202\202 \207" [([nil 22077 4073 787364 1 etc-clear-truncate-timer (#<buffer $shell<5>>) nil 553000] [nil 22077 4074 0 1 buffer-tail ("*mandimus-server*") nil 0] [nil 22077 4087 730233 60 etc-set-repeat-rate nil nil 16000] [nil 22077 4102 266712 30 erc-server-send-ping (#<buffer irc.freenode.net:6667>) nil 804000] [nil 22077 4206 596849 300 savehist-autosave nil nil 963000] [nil 22077 53928 0 86400 run-hooks (midnight-hook) nil 0]) nil 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
(defvar-local eshell-hist-dirs nil) | |
(defvar-local eshell-hist-index 0) | |
(defun etc-eshell-update-hist-dir () | |
;; prevent "cd /tmp" over and over from making new entries | |
(when (not (equal (car (last eshell-hist-dirs)) (eshell/pwd))) | |
(push (eshell/pwd) eshell-hist-dirs))) | |
(add-hook 'eshell-directory-change-hook #'etc-eshell-update-hist-dir) |
NewerOlder