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
pub trait Apply { | |
type ValidValue; | |
fn apply(self, consumer: impl Fn(&mut Self::ValidValue)) -> Self | |
where | |
Self: Sized; | |
fn apply_ref(&mut self, consumer: impl Fn(&mut Self::ValidValue)) -> &mut Self; | |
} | |
default impl<T> Apply for 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
#![feature(prelude_import)] | |
#[prelude_import] | |
use std::prelude::rust_2021::*; | |
#[macro_use] | |
extern crate std; | |
use litesim::prelude::*; | |
pub struct Player; | |
#[cfg(feature = "rewind")] | |
impl<'s> RewindModel<'s> for Player { | |
type RewindBackup = Self; |
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
p { | |
display: inline-block; // fallback for CSS4 | |
display: -webkit-inline-box; // specialized renderer supported by all major browsers | |
-webkit-box-orient: vertical; // Required by FF for -webkit-line-clamp | |
-webkit-line-clamp: 1; | |
line-clamp: 1; // Forward CSS4 support | |
font-size: var(--size); | |
line-height: calc(var(--size) * 1.2); // leave wiggle room for descending characters (e.g. jy...) | |
overflow: hidden; // required for ellipsis |
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
/** | |
* Behaves like useEffect, but the hook function recieves changed iterable values as an argument. | |
* | |
* @param {(changed: any) => ((changed: any) => void)} call | |
* @param {Iterable} iter Primary dependency and iterable that's operated on | |
* @param {any[]} dependencies Additional dependencies | |
* @param {(a: any, b: any) => boolean} matcher Equality comparator used for comparing previous and new values, dequal (deep-equal) by default | |
*/ | |
export function useEffectEach(call, iter, dependencies = [], matcher = dequal) { |
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
.dictionary-view { | |
display: contents; | |
} | |
.dictionary-view * { | |
box-sizing: border-box; | |
padding: 0; | |
margin: 0; | |
} | |
.dictionary-view .search-bar { |
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 python3 | |
from time import sleep | |
from datetime import datetime, timedelta, timezone | |
from dateutil.parser import isoparse | |
from aw_core.models import Event | |
from aw_client import ActivityWatchClient | |
# Server settings |
Explain why the following sentence is wrong: "Estoy esperando dar a luz pronto a un bebé"
The sentence "Estoy esperando dar a luz pronto a un bebé" is grammatically incorrect. The correct sentence would be "Estoy esperando dar a luz pronto a mi bebé" or "Estoy esperando dar a luz a un bebé pronto." In Spanish, it's more natural to say "dar a luz" instead of "tener un bebé."
Why? Can you explain those phrases in English?
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
/// Match target_os compile time constant. | |
/// | |
/// Usage: | |
/// ``` | |
/// match_os! { | |
/// "windows" => println!("hello from windows"), | |
/// "linux" | "macos" => { | |
/// println!("hello from unix") | |
/// }, |
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
/* | |
* Copyright © 2021 Tin Švagelj <[email protected]> | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy of this | |
* software and associated documentation files (the “Software”), to deal in the Software | |
* without restriction, including without limitation the rights to use, copy, modify, | |
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to | |
* permit persons to whom the Software is furnished to do so, subject to the following | |
* conditions: | |
* |