Skip to content

Instantly share code, notes, and snippets.

View Lapz's full-sized avatar

Lenard Pratt Lapz

View GitHub Profile
@Lapz
Lapz / Tile.ts
Created January 6, 2020 18:03
Toast.ts
const ProductTile: React.FC<IProductTileProps> = ({
id,
name,
stock,
price
}) => {
const [addToCart, { error }] = useMutation(ADD_TO_CART)
const [displayToasty, setDisplayToasty] = useState(false)
const handleSubmit = () => {
@Lapz
Lapz / backtrace.rs
Last active April 26, 2019 18:25
RLS Backtrace
rust_panic (@103b834f0..103b83560:9)
update_count_then_panic (@103b83430..103b834c0:30)
resume_unwind (@103b7b440..103b7b450:6)
ra_db::cancellation::Canceled::throw::hb0cda3f20a9a8c11 (/Users/lenardpratt/Projects/Rust/rust-analyzer/crates/ra_db/src/cancellation.rs:32)
_$LT$T$u20$as$u20$ra_db..CheckCanceled$GT$::check_canceled::h9c1aea35ae6afe28 (/Users/lenardpratt/Projects/Rust/rust-analyzer/crates/ra_db/src/lib.rs:49)
ra_hir::ty::infer::infer::h9d3158b7399d9430 (/Users/lenardpratt/Projects/Rust/rust-analyzer/crates/ra_hir/src/ty/infer.rs:52)
_$LT$ra_hir..db..InferQuery$u20$as$u20$salsa..plumbing..QueryFunction$LT$DB$GT$$GT$::execute::h96b6bcfc0a279520 (/Users/lenardpratt/Projects/Rust/rust-analyzer/crates/ra_hir/src/db.rs:117)
_$LT$salsa..derived..DerivedStorage$LT$DB$C$$u20$Q$C$$u20$MP$GT$$GT$::read_upgrade::_$u7b$$u7b$closure$u7d$$u7d$::hfc1bb3a510c2fe5f (/Users/lenardpratt/.cargo/registry/src/github.com-1ecc6299db9ec823/salsa-0.12.0/src/derived.rs:376)
_$LT$salsa..runtime..Runtime$LT$DB$GT$$GT$::execute_q
@Lapz
Lapz / main.rs
Created February 14, 2019 19:07
Peter Sesoft
use std::collections::HashMap;
use std::hash::Hash;
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
enum Value {
True,
False,
String(String),
Var(String),
}
#### TASK 2 ###
import re
from collections import Counter
inputString = input("Enter the sentence that you want me to check");
positionOfWord = [];
#### Input string sanitization start ####
@Lapz
Lapz / task1.py
Last active February 15, 2017 12:37
Task 1
##### Task 1
import re
inputString = input("Enter the sentence that you want me to check");
wordToCheck = input("Which word do you want to check for position");
positionOfWord = [];
#### Input string sanitization start ####