Skip to content

Instantly share code, notes, and snippets.

use async_std::task::block_on;
use async_std::task::{sleep, spawn};
use pin_project_lite::pin_project;
use std::future::Future;
use std::pin::Pin;
use std::task::{Context, Poll};
use std::time::Duration;
pin_project! {
struct TwoFutures<Fut1, Fut2> {
@Minoru
Minoru / urlextract.cpp
Created November 11, 2017 11:00
Extract <link rel="alternate"> feeds from a webpage (by @noctux; https://paste.xinu.at/RRug/)
#include <curl/curl.h>
#include <cstddef>
#include <iostream>
#include <vector>
#include <cstring>
#include <libxml/HTMLparser.h>
#include <libxml/tree.h>
#include <libxml/parser.h>
#include <libxml/xpath.h>
Thread 3 (Thread 0x7f236da08700 (LWP 26588)):
#0 0x00007f237227f190 in nanosleep () from /usr/lib/libc.so.6
No symbol table info available.
#1 0x00007f237227f09a in sleep () from /usr/lib/libc.so.6
No symbol table info available.
#2 0x000055a0a2ecd376 in newsbeuter::reloadthread::operator() (this=0x55a0a443e988) at src/reloadthread.cpp:40
seconds_to_wait = <optimized out>
#3 0x00007f2372842a6f in std::execute_native_thread_routine (__p=0x55a0a443e980) at /build/gcc/src/gcc/libstdc++-v3/src/c++11/thread.cc:83
__t = std::unique_ptr<std::thread::_State> containing 0x55a0a443e980
@Minoru
Minoru / i18nspector-9999.ebuild
Created October 25, 2016 21:05
My dev-util/i18nspector-9999 ebuild
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI=5
PYTHON_COMPAT=( python3_4 )
inherit eutils python-single-r1
DESCRIPTION="Checking tool for gettext POT, PO and MO files"
@Minoru
Minoru / log.txt
Created October 3, 2016 11:21
У каждой платформы есть дно
Это логи чата, а не протокол какого-то собрания, так что просьба шуточки про JS
близко к сердцу не принимать. Кроме того, речь идёт о JVM, Erlang VM, браузерах,
native, поэтому слово «абстракция» следует понимать как «платформа». —Minoru
Из codingteam@conference.jabber.ru:
<ForNeVeR> ɹǝɟılʍǝu: смотри что. У JS есть своя семантика (модель памяти,
выполнения, и проч.). Прямых маппингов на машинную модель у неё нету.
JS не зависит от машины. Поэтому, чтобы писать на JS, тебе нужно
@Minoru
Minoru / example.ml
Last active April 14, 2016 17:04
OCamlin' along with @rexim
let on f g = fun x y -> f (g x) (g y)
(* uncurry from https://thelema.github.io/batteries-included/hdoc/BatPervasives.html
dunno if you can use that *)
(* line 15 can't be rewritten like that.
I'm still trying to come up with another solution, but it's really different from the other two *)
(* line 16 *)
List.map (fun (vx, vy) -> atan2 (float_of_int vy) (float_of_int vx))
@Minoru
Minoru / test.html
Created April 10, 2016 18:50
Trying to shrink an image to container's height
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>test</title>
<link rel="stylesheet" href="http://loglist.net/stylesheets/reset.css">
<style type="text/css" media="screen">
.plate {
background: #aaaaaa;
}
@Minoru
Minoru / start.txt
Last active August 29, 2015 14:04
Предлагаемые правки для главной nethack-rutext
{{ :nh4tx.gif?nolink&300 |}}
<WRAP center round info 60%>
* [[wpru>Jabber]]-конференция: **nethack@conference.jabber.ru**
* Группа ВКонтакте: [[http://vk.com/club10804897]]
* Старая версия сайта находится по адресу: [[http://nethack.ucoz.com/|nethack.ucoz.com]]
</WRAP>
**[[http://ru.wikipedia.org/wiki/NetHack|NetHack]]** — компьютерная ролевая игра. Она представляет собой очень сложный, динамический и непредсказуемый мир подземелий, в котором игрок сражается с различными существами, торгует, развивается и продвигается всё ниже по уровням ради того, чтобы завладеть [[nw>Amulet_of_Yendor|Амулетом Йендора]].
@Minoru
Minoru / command
Created January 26, 2014 19:12
Solution to Mayoi Hachikuji's problem of matching something like "wtf (.+) going (.+) (.+)" in a way so that \1 ≠ \2 ≠ \3
echo 'wtf is going is is\nwtf is going is on\nwtf is going is guys\nwtf is going on is\nwtf is going on on\nwtf is going on guys\nwtf is going guys is\nwtf is going guys on\nwtf is going guys guys\nwtf on going is is\nwtf on going is on\nwtf on going is guys\nwtf on going on is\nwtf on going on on\nwtf on going on guys\nwtf on going guys is\nwtf on going guys on\nwtf on going guys guys\nwtf guys going is is\nwtf guys going is on\nwtf guys going is guys\nwtf guys going on is\nwtf guys going on on\nwtf guys going on guys\nwtf guys going guys is\nwtf guys going guys on\nwtf guys going guys guys' | \
perl -ne '$i++; if ( $_ =~ /^wtf (\w+) going (?!.*\1.*)(\w+) (?!.*\2.*)(\w+)$/ ) { print $i, ": ", $1, "--", $2, "--", $3, "\n"; }'
@Minoru
Minoru / palmrest_ergonomics.markdown
Created December 10, 2013 06:28
Results of my little Internet research conducted to answer the following question: can I rest my wrists/palms on the wrist/palm rest while typing/using a mouse?

The question: Can I rest my wrists/palms on the wrist/palm rest while typing/using a mouse?

Key

Marks before the source URL indicates the main tone of the source in regard of wrist/palm rests:

[xy]
 ^^