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
#!/bin/bash | |
# Function to print the multimedia key table | |
print_multimedia_table() { | |
echo "+------------------------------------------------+" | |
echo "| Win system key combination |" | |
echo "+------------------------------------------------+" | |
echo "| Multimedia function keys must be pressed with |" | |
echo "| the FN+CTRL key combination |" | |
echo "| (Ice blue light appears underneath the FN |" |
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
#!/bin/bash | |
current=$(dconf read /org/gnome/desktop/input-sources/xkb-options) | |
swapped="['caps:swapescape']" | |
capslock="['caps:capslock']" | |
echo "Current status: $current" | |
if [ "$current" == "$swapped" ] | |
then | |
echo "Making caps and escape WORK NORMALLY" |
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
use std::time::Instant; | |
fn main() { | |
let iterations = 1_000_000; | |
let mut odd_count = 0; | |
// Using modulus | |
let start_modulus = Instant::now(); | |
for i in 0..iterations { | |
if i % 2 != 0 { |
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
from itertools import chain, repeat | |
# Define the inventory as a dictionary | |
inventory = { | |
"banana": 3, | |
"apple": 2, | |
"pear": 1, | |
"berry": 4, | |
} |
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
<div class="block content has-background-light p-4"> | |
<strong>Discussions around the web:</strong> | |
<div id="comment" data-discussion-url="https://www.joelonsoftware.com/2000/04/06/things-you-should-never-do-part-i"> | |
<ul></ul> | |
</div> | |
<p class="pt-2">Powered by <a href="https://discu.eu">discu.eu</a>.</p> | |
</div> |
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
mod domain { | |
use std::{fmt::Display, ops::Deref}; | |
#[derive(Debug)] | |
pub enum DomainError { | |
InvalidEmailAddress, | |
InvalidResponseCode, | |
} | |
#[derive(Clone, PartialEq)] |
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
mod domain { | |
use std::ops::Deref; | |
pub struct ViewCount { value: usize } | |
impl ViewCount { | |
pub fn new(value: usize) -> Self { | |
Self { value } | |
} | |
} |
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
struct Point { | |
x: usize, | |
y: usize | |
} |
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
mod domain { | |
pub struct ViewCount { | |
value: usize, | |
} | |
impl ViewCount { | |
pub fn new(value: usize) -> Self { | |
Self { value } | |
} | |
pub fn value(&self) -> usize { | |
self.value |
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
impl PageSize { | |
pub fn new_from_kilobytes(value: usize) -> Result<Self, DomainError> { | |
Ok(Self { value }) | |
} | |
pub fn as_bytes(&self) -> usize { | |
&self.value / 1_000 | |
} | |
pub fn as_kilobytes(&self) -> usize { | |
self.value | |
} |
NewerOlder