Skip to content

Instantly share code, notes, and snippets.

@o0Ignition0o
o0Ignition0o / bastion_floating_on_tide2.rs
Created Jun 28, 2020
Bastion floating on tide part 2: Building a bastion
View bastion_floating_on_tide2.rs
use async_std::task;
use bastion::{blocking, context::BastionContext, msg, prelude::ChildrenRef, Bastion};
mod prime_number {
use std::{
iter,
time::{Duration, Instant},
};
#[derive(Debug)]
View terribletryouts.js
// destructuring
const monPerso = {
nom: "Jeremy",
lvl: 42,
classe: "mage"
};
console.log(monPerso.classe)
console.log(monPerso.lvl)
@o0Ignition0o
o0Ignition0o / bastion_floating_on_tide1.rs
Created Feb 23, 2020
Bastion floating on tide example!
View bastion_floating_on_tide1.rs
use std::iter;
// in order to determine if n is prime
// we will use a primality test.
// https://en.wikipedia.org/wiki/Primality_test#Pseudocode
fn is_prime(n: u128) -> bool {
if n <= 3 {
n > 1
} else if n % 2 == 0 || n % 3 == 0 {
false
View prime.rs
use std::iter;
// in order to determine if n is prime
// we will use a primality test.
// https://en.wikipedia.org/wiki/Primality_test#Pseudocode
fn is_prime(n: u128) -> bool {
if n <= 3 {
n > 1
} else if n % 2 == 0 || n % 3 == 0 {
false
View main.rs
fn fib_nth(n: usize) -> usize {
if n == 0 || n == 1 {
n
} else {
fib_nth(n - 1) + fib_nth(n - 2)
}
}
async fn fibsum(req: tide::Request<()>) -> String {
use std::time::Instant;
View patch.diff
diff --git a/.gitignore b/.gitignore
index 785b5da6..b17d9aac 100644
--- a/.gitignore
+++ b/.gitignore
@@ -358,11 +358,14 @@ xcuserdata/
!*.xcworkspace/contents.xcworkspacedata
/*.gcno
+# Unity
/Unity/UnityDemo/Library
@o0Ignition0o
o0Ignition0o / # llvm-5.0 - 2020-01-16_21-09-26.txt
Created Jan 16, 2020
llvm-5.0 (llvm-hs/llvm/llvm-5.0) on macOS 10.15.2 - Homebrew build logs
View # llvm-5.0 - 2020-01-16_21-09-26.txt
Homebrew build logs for llvm-hs/llvm/llvm-5.0 on macOS 10.15.2
Build date: 2020-01-16 21:09:26
@o0Ignition0o
o0Ignition0o / main.rs
Created Dec 3, 2019
on joue avec des results
View main.rs
use rand::prelude::*;
#[derive(Debug)]
struct JaiPasDentierError {}
#[derive(Debug)]
struct JaiPasReussiError {}
#[derive(Debug)]
enum MyError {
@o0Ignition0o
o0Ignition0o / mount.rs
Created Nov 4, 2018
yew rust framework: mount component to dom macro
View mount.rs
pub enum MountError {
QuerySelectorError,
ElementNotFound(String)
}
impl From<TODO> for MountError {
fn from(_: TODO) -> Self {
MountError::QuerySelectorError
}
View main.rs
#![crate_type = "staticlib"]
//#![feature(test)]
//extern crate test;
use std::slice;
use std::str;
#[inline]
fn try_apply_digit(current_octet: u8, digit_to_apply: u8) -> Option<u8> {
current_octet.checked_mul(10)?.checked_add(digit_to_apply)
You can’t perform that action at this time.