Skip to content

Instantly share code, notes, and snippets.

View cpdean's full-sized avatar

Conrad cpdean

View GitHub Profile
@cpdean
cpdean / decider.py
Created September 10, 2018 22:14
Decider
i>>> import random
>>> ['do it', 'no', 'no', 'no'][random.randrange(4)]
'no'
>>> ['do it', 'no', 'no', 'no'][random.randrange(4)]
'no'
>>> ['do it', 'no', 'no', 'no'][random.randrange(4)]
'no'
>>> ['do it', 'no', 'no', 'no'][random.randrange(4)]
'no'
>>> ['do it', 'no', 'no', 'no'][random.randrange(4)]
- ❯❯❯ python3
Python 3.7.1 (default, Nov 6 2018, 18:45:35)
[Clang 10.0.0 (clang-1000.11.45.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> def goat(n: int) -> str:
... """ an goat str """
... return 'goat'
...
>>> print(goat.__doc__)
an goat str
@cpdean
cpdean / test.txt
Created September 12, 2019 16:53 — forked from jamesmunns/test.txt
james@archx1c6g ➜ write-test git:(master) ✗ cat ./src/main.rs
use std::io::Write;
fn main() {
for _ in 0..10 {
writeln!(
::std::io::stdout().lock(),
"Hello, world!"
).unwrap_or_else(|_| {
eprintln!("stderr: Hello, stderr!");
def fib(n):
if n in (0, 1):
return 1
return fib(n-1) + fib(n - 2)
def fib_better(n):
if n == 0:
return 0
return fib(n - 1) + fib_better(n - 1)
@cpdean
cpdean / what.sh
Created June 8, 2022 17:01
startup vim
[No Name] 0,0-1 All
1 startup: 147.7
2 event time percent plot