Skip to content

Instantly share code, notes, and snippets.

View cbzehner's full-sized avatar
🚀

Chris Zehner cbzehner

🚀
View GitHub Profile
Ones where I could find T&C:
https://www.octoparse.com/terms-and-conditions
https://dexi.io/terms
https://www.screamingfrog.co.uk/seo-spider/terms-conditions/
https://www.import.io/terms-conditions/ (<-- They also have a GDPR section, might be interesting)
https://www.incapsula.com/terms-of-use.html
Others: You can try searching google with `site:<website> Terms` to only search a specific site for pages that have "Terms" somewhere on the site.
http://webscraper.io/
https://scrapy.org/
def find_love(r1, r2):
(x_start, x_end) = x_overlap(r1, r2)
(y_start, y_end) = y_overlap(r1, r2)
if x_start is None:
return "x_start there can be no love!"
if x_end is None:
return "x_end there can be no love!"
if y_start is None:
@cbzehner
cbzehner / largest_in_stack.py
Created May 1, 2018 19:15
Largest Item In Stack
class MaxStack(Stack):
def __init__(self):
Stack.__init__()
self.max = []
def push(self, item):
self.items.append(item)
if item > self.max):
self.max.push(item)
@cbzehner
cbzehner / Dockerfile
Created February 26, 2020 07:36
Rocket Dockerfile
FROM rustlang/rust:nightly
MAINTAINER "[email protected]"
ENV BUILD_DIR=/usr/src/<app_name>
RUN mkdir -p $BUILD_DIR
WORKDIR $BUILD_DIR
# TODO: Confirm this is actually needed to run `diesel setup`
# RUN cargo install diesel_cli --no-default-features --features postgres
use scrypt::{scrypt_check, scrypt_simple, ScryptParams};
#[derive(Copy, Clone)]
enum Mode {
Raw,
Digest,
}
/// Securely store a password in a format where the raw value of the password is not acessible.
#[derive(Clone)]
@cbzehner
cbzehner / console.sh
Created March 27, 2021 23:35
example/request_local_state with a non-unit error type on Guard 1
❯ cargo check
Checking request_local_state v0.0.0 (/Users/cbzehner/Projects/open-source/Rocket/examples/request_local_state)
error[E0053]: method `from_request` has an incompatible type for trait
--> request_local_state/src/main.rs:28:5
|
28 | async fn from_request(req: &'r Request<'_>) -> request::Outcome<Self, ()> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `std::string::String`, found `()`
|
= note: expected fn pointer `fn(&'r rocket::Request<'life0>) -> Pin<Box<(dyn std::future::Future<Output = rocket::outcome::Outcome<Guard1, (Status, std::string::String), ()>> + std::marker::Send + 'async_trait)>>`
found fn pointer `fn(&'r rocket::Request<'life0>) -> Pin<Box<(dyn std::future::Future<Output = rocket::outcome::Outcome<Guard1, (Status, ()), ()>> + std::marker::Send + 'async_trait)>>`
@cbzehner
cbzehner / Cargo.toml
Last active September 20, 2023 08:27
Prompt for missing values in Clap
[package]
name = "clap_prompt_example"
version = "0.1.0"
edition = "2021"
[dependencies]
clap = { version = "3.1", features = ["derive"] }
dialoguer = "0.10"