Skip to content

Instantly share code, notes, and snippets.

View Hackdemon23's full-sized avatar
🎯
Focusing

Hackdemon23 Hackdemon23

🎯
Focusing
View GitHub Profile
@Hackdemon23
Hackdemon23 / playground.rs
Created December 2, 2019 23:08 — forked from rust-play/playground.rs
Code shared from the Rust Playground
fn main() {
let u: Vec<usize> = vec![];
let v = vec![0, 1, 2];
let w = vec![0, 1, 2, 3, 4, 5];
let a = u.get(1..).unwrap_or(&[]).chunks(3).next().unwrap_or(&[]);
let b = v.get(1..).unwrap_or(&[]).chunks(3).next().unwrap_or(&[]);
let c = w.get(1..).unwrap_or(&[]).chunks(3).next().unwrap_or(&[]);
println!("{:?}\n{:?}\n{:?}", a, b, c);
@Hackdemon23
Hackdemon23 / playground.rs
Created December 2, 2019 23:08 — forked from rust-play/playground.rs
Code shared from the Rust Playground
fn main() {
let u: Vec<usize> = vec![];
let v = vec![0, 1, 2];
let w = vec![0, 1, 2, 3, 4, 5];
let a = u.get(1..).unwrap_or(&[]).chunks(3).next().unwrap_or(&[]);
let b = v.get(1..).unwrap_or(&[]).chunks(3).next().unwrap_or(&[]);
let c = w.get(1..).unwrap_or(&[]).chunks(3).next().unwrap_or(&[]);
println!("{:?}\n{:?}\n{:?}", a, b, c);
@Hackdemon23
Hackdemon23 / playground.rs
Created December 2, 2019 23:06 — forked from rust-play/playground.rs
Code shared from the Rust Playground
fn main() {
println!("Hello, GCI!");
}
@Hackdemon23
Hackdemon23 / clone_all.sh
Created December 2, 2019 23:05 — forked from chrisdlangton/clone_all.sh
Quick clone all org repos using Github Enterprise API v3
#!/usr/bin/env bash
prefix_url='https://github......'
declare -a groups=(
"my"
"org"
"groups"
)
@Hackdemon23
Hackdemon23 / test_pfs.py
Created December 2, 2019 22:56 — forked from chrisdlangton/test_pfs.py
Enforcing Perfect Forward Secrecy for AWS Query Request HTTP API
"""
Based on https://docs.aws.amazon.com/general/latest/gr/sigv4-signed-request-examples.html
"""
from requests.packages.urllib3.util.ssl_ import create_urllib3_context
from requests.adapters import HTTPAdapter
import hmac
import hashlib
import datetime
import base64
import os