This file contains hidden or 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
| // Cargo.toml | |
| // | |
| // [dependencies] | |
| // serde_json = "1.0.61" | |
| // notify = "4.0.15" | |
| // anyhow = "1.0.38" | |
| // fantoccini = "0.17.1" | |
| // tokio = {version="1.1.1", features= ["full"]} | |
| // log = "0.4.14" | |
| // env_logger = "0.8.2" |
This file contains hidden or 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 core::{num, slice}; | |
| use std::{io::Lines, string}; | |
| const STRING_BORDER: char = '"'; | |
| #[derive(Debug)] | |
| enum NonTerminal { | |
| ArgumentOpen, | |
| ArgumentClose, | |
| BlockOpen, |
This file contains hidden or 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 core::fmt; | |
| use fmt::Display; | |
| use serde::{ | |
| ser::{Error, SerializeMap, SerializeSeq}, | |
| serde_if_integer128, Deserialize, Serialize, Serializer, | |
| }; | |
| fn main() { | |
| #[derive(Serialize, Deserialize)] | |
| struct Demo { |
This file contains hidden or 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 rand; | |
| use std::{ | |
| fmt, | |
| io::{stdin, Read}, | |
| }; | |
| fn main() { | |
| run(); | |
| } |
This file contains hidden or 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::pin::Pin; | |
| pub fn test1() { | |
| let mut test1 = Test::new("test1"); | |
| test1.init(); | |
| let mut test1_pin = Pin::new(&mut test1); | |
| let mut test2 = Test::new("test2"); | |
| test2.init(); | |
| let mut test2_pin = Pin::new(&mut test2); |
This file contains hidden or 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::thread; | |
| use std::sync::atomic::{AtomicBool, Ordering}; | |
| const LOCKED: AtomicBool = AtomicBool::new(false); | |
| static mut COUNTER: usize = 0; | |
| #[inline(always)] | |
| pub fn test(inc: usize) { | |
| while LOCKED.compare_and_swap(true, false, Ordering::Relaxed) { | |
| } |
This file contains hidden or 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
| ############################################################ | |
| # Powershell script to set date and time settings and update Windows | |
| # Author: Joshua Haupt [email protected] Date: 22.12.2017 | |
| ############################################################ | |
This file contains hidden or 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 tiberius::SqlConnection; | |
| use futures::Future; | |
| use futures_state_stream::StateStream; | |
| use tokio_current_thread::block_on_all; | |
| fn main() { | |
| init(); | |
| create(); | |
| batch_insert(); |
This file contains hidden or 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 StoreResult { | |
| saved: String, | |
| } | |
| #[allow(unused_variables, non_upper_case_globals)] | |
| const __IMPL_RESPONSE_FOR_StoreResult: () = { | |
| extern crate tower_web as __tw; | |
| impl __tw::response::Response for StoreResult { | |
| type Buf = <Self::Body as __tw::util::BufStream>::Item; | |
| type Body = __tw::error::Map<__tw::codegen::bytes::Bytes>; |
This file contains hidden or 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::fmt; | |
| macro_rules! txt_concat { | |
| ($($model: expr), *) => {{ | |
| let mut s = String::new(); | |
| $( | |
| if let Some(t) = $model { | |
| s.push_str(&t); | |
| s.push(' '); |
NewerOlder