Skip to content

Instantly share code, notes, and snippets.

View cpdean's full-sized avatar

Conrad cpdean

View GitHub Profile
@cpdean
cpdean / preonic.txt
Created November 22, 2017 14:40
easy reference of preonic default layout
Qwerty
,-----------------------------------------------------------------------------------.
| ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
|------+------+------+------+------+------+------+------+------+------+------+------|
| Tab | Q | W | E | R | T | Y | U | I | O | P | Del |
|------+------+------+------+------+-------------+------+------+------+------+------|
| Esc | A | S | D | F | G | H | J | K | L | ; | " |
|------+------+------+------+------+------|------+------+------+------+------+------|
| Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
|------+------+------+------+------+------+------+------+------+------+------+------|
@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
@cpdean
cpdean / doge.md
Last active November 21, 2021 08:51
YOU'RE WELCOME, INTERNET. -- if you search for an ascii doge, you don't get anything great that you can copy paste. found a silly gif (http://cmang.org/ascii/cm-doge-bw.gif) and i have transcribed it for all of you

no clue who made this, but ARTIST FOUND thank you @indyjoenz / cmang!

i have transcribed it here:

                Y.                      _   
                YiL                   .```.  
                Yii;                .; .;;`.    
                YY;ii._           .;`.;;;; :    
 iiYYYYYYiiiii;;;;i` ;;::;;;; 
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 / 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!");
@cpdean
cpdean / apache.wsgi
Created June 27, 2013 23:38
wsgi apache setup with error logging and virtualenv
import sys
sys.stdout = sys.stderr
sys.path.insert(0,'/home/user/public/appname.example.com/public/appname')
activate_this = '/home/user/public/appname.example.com/public/appname/appvirtualenv/bin/activate_this.py'
execfile(activate_this, dict(__file__=activate_this))
from app import app as application
- ❯❯❯ 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 / 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)]
@cpdean
cpdean / fix-it.sh
Last active January 31, 2018 01:52
setting global logging for your users is a terrible transgression
(tmp-d03b8292d70950f0) - - -
tmp-d03b8292d70950f0 0
- ❯❯❯ python
Python 2.7.13 (default, Jul 18 2017, 09:17:00)
[GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.42)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import warnings
>>> warnings.filterwarnings('ignore')
>>> import sklearn.cross_validation
@cpdean
cpdean / build-all.sh
Last active January 2, 2018 16:34
crawl a directory of nodejs projects
#!/bin/bash
REPOS=$(find . -type d -depth 1)
for i in $REPOS; do
echo building $i
cd $i
git pull
rm -rf node_modules
yarn install
cd -
done