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
#[derive(Debug)] | |
struct Structure { | |
name: String, | |
} | |
#[derive(Debug)] | |
struct StructVector(Vec<Structure>); | |
impl StructVector { | |
fn by_name(&self, name: &str) -> Option<&Structure> { |
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
//! Licensed under either of: | |
//! - Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0) | |
//! - MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT) | |
//! | |
//! This file may not be copied, modified, or distributed except according to those terms. | |
use std::marker::PhantomData; | |
use serde::{__private::de as private_de, de}; |
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
!function () { | |
const shuffleVelocityMs = 50; | |
const shuffleElement = (element) => { | |
const elemText = element.getAttribute("data-text"); | |
const elemementChars = Array.from(elemText); | |
const shuffleChars = (chars) => { | |
for (let idx = chars.length; --idx; ) { | |
const randomIdx = parseInt(Math.random() * idx); |
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
fn next_greater_elems<T: Copy + PartialOrd>(array: &[T]) -> Box<[Option<T>]> { | |
let array_len = array.len(); | |
let mut stack = Vec::<usize>::with_capacity(array_len); | |
let mut result = Vec::<Option<T>>::with_capacity(array_len); | |
stack.push(0); | |
result.push(None); | |
for (index, element) in array.iter().enumerate().skip(1) { | |
result.push(None); |
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
<?php declare(strict_types = 1); | |
// Tried on PHP 8.0.25 | |
// Trait | |
trait TestTrait { | |
public static function spawnSelf(): self { | |
return new self(); | |
} | |
public static function spawnStatic(): static { |
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 | |
# Copyright 2022 Giuseppe Eletto <giuseppe@eletto.me> | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
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
/** | |
* MIT License | |
* | |
* Copyright (c) 2022 Giuseppe Eletto <giuseppe@eletto.me> | |
* | |
* 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 |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width,initial-scale=1.0" /> | |
<title>base64 + lzma + iframe</title> | |
<style>iframe{position:absolute;top:0;left:0;height:100vh;width:100%;border:none}</style> | |
</head> | |
<body> | |
<iframe sandbox="allow-same-origin allow-downloads allow-scripts allow-forms allow-top-navigation allow-popups allow-modals allow-popups-to-escape-sandbox"></iframe> |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>Dead simple JS Calculator</title> | |
<style> | |
body { | |
background-color: whitesmoke; | |
margin: 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
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'> | |
<!-- ... --> | |
<devices> | |
<!-- ... --> | |
<interface type="user"> | |
<!-- ... --> | |
<model type="e1000e"/> | |
<!-- ... --> | |
</interface> | |
<!-- ... --> |
NewerOlder