Skip to content

Instantly share code, notes, and snippets.

use std::process::{ Command, Stdio };
use std::io::{ Read, BufReader, Error, ErrorKind };
fn main() -> Result<(), Error> {
let external_process_name = "..."; // some process name that prints:
// line 1
// .. waits for 2 seconds ..
// line 2
// .. waits for 2 seconds ..
// line 3
public static class YieldInstructionExtension
{
public static YieldInstructionAwaiter GetAwaiter(this YieldInstruction yieldInstruction)
{
return new YieldInstructionAwaiter(yieldInstruction);
}
}
public class YieldInstructionAwaiter : INotifyCompletion
{
public static class UnityWebRequestExtensions
{
public static UnityWebRequestAwaiter GetAwaiter(this UnityWebRequestAsyncOperation asyncOperation)
{
return new UnityWebRequestAwaiter(asyncOperation);
}
}
public class UnityWebRequestAwaiter : INotifyCompletion
{
type FadeToBgCommand = {
background: string
}
type PlayMusicCommand = {
trackName: string
}
type LockClosetCommand = {}
dialoguePanel.DOSizeDelta(new Vector2(_dialogWeight, LayoutUtility.GetPreferredHeight(dialoguePanel) + 20f), animSettings.portraitAnimationDuration / 1.2f).OnComplete(() =>
// Второй вариант
dialoguePanel
.DOSizeDelta(
new Vector2(_dialogWeight, LayoutUtility.GetPreferredHeight(dialoguePanel) + 20f),
animSettings.portraitAnimationDuration / 1.2f)
.OnComplete(() =>
// Третий вариант
using System;
using DG.Tweening;
using UnityEngine;
using UnityEngine.UI;
public class CheckPreferredHeight : MonoBehaviour
{
public RectTransform targetRect;
private RectTransform _currentRect;
{"inkVersion":18,"root":[[["^I looked at Monsieur Fogg","\n",["ev",{"^->":"0.g-0.2.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^... and I could contain myself no longer.",{"->":"$r","var":true},null]}],["ev",{"^->":"0.g-0.3.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-1","flg":18},{"s":["^... but I said nothing",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"0.g-0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.2.s"},[{"#n":"$r2"}],"\n","^'What is the purpose of our journey, Monsieur?'","\n","^'A wager,' he replied.","\n",[["ev",{"^->":"0.g-0.c-0.11.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^'A wager!'",{"->":"$r","var":true},null]}],["ev",{"^->":"0.g-0.c-0.11.1.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","str","^.'","/str","/ev",{"*":".^.^.c-1","flg":22},{"s":["^'Ah",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"0.g-0.c-0.11.c-0.
{"inkVersion":18,"root":[[["^I looked at Monsieur Fogg","\n",["ev",{"^->":"0.g-0.2.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^... and I could contain myself no longer.",{"->":"$r","var":true},null]}],["ev",{"^->":"0.g-0.3.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-1","flg":18},{"s":["^... but I said nothing",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"0.g-0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.2.s"},[{"#n":"$r2"}],"\n","^'What is the purpose of our journey, Monsieur?'","\n","^'A wager,' he replied.","\n",[["ev",{"^->":"0.g-0.c-0.11.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^'A wager!'",{"->":"$r","var":true},null]}],["ev",{"^->":"0.g-0.c-0.11.1.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","str","^.'","/str","/ev",{"*":".^.^.c-1","flg":22},{"s":["^'Ah",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"0.g-0.c-0.11.c-0.
// -------------------------------
// Common action invoker interface
public interface IActionInvoker
{
string InvokingActionType { get; }
void Execute(Contexts contexts);
}
// -------------------------------
// Code from TextMeshPro
using System;
using System.Collections.Generic;
namespace TMPro
{
public class FastAction<A>
{
private LinkedList<Action<A>> delegates = new LinkedList<Action<A>>();