public
3 files
# Outdated
See [this repo](https://gitlab.com/jkcclemens/note) for more updates.
- `note.sh` is the file to be sourced
- `_note` is a zsh shell completion file
public
1 file
#!/bin/sh
(curl -sSf https://www.cloudflare.com/ips-v4 && curl -sSf https://www.cloudflare.com/ips-v6) | \
while read -r line; do echo "set_real_ip_from $line;"; done
echo
echo "real_ip_header CF-Connecting-IP;"
public
1 file
![bitcoin-chan](https://pbs.twimg.com/media/DqJo4XUU8AAVUcl.jpg:large)
public
1 file
# Adding custom fonts to Apple Books
I haven't found any resources on the web for how to do this, so I dove into `Books.app` and figured out how to add your own fonts to the font list in Apple Books.
![example](https://kyleclemens.com/assets/Screenshot%202018-10-31%20at%2012.36.10.png)
*Bookerly is now available.*
public
1 file
[Watch it.](https://www.youtube.com/watch?v=sHAkDTlv8fA)
<small>I typed this from 2 to 3:30 in the morning, so forgive me if grammar is wonky or there are misspellings spellcheck didn't catch.</small>
public
1 file
```
This is a pre that is first child.
```
This is a bare link: https://github.com/jkcclemens/paste/commit/80279084d90cd493bb26d239fb966fdde159eea7.
Here is another bare link: https://www.youtube.com/watch?v=IHNzOHi8sJs&feature=youtu.be.
This is a bare link (https://paste.gg/users/jkcclemens) to our site!
public
1 file
Hello!
I'm the primary developer of this pastebin that you're on right now (hopefully). It's called
[paste](https://github.com/jkcclemens/paste), and it's my baby.
I'd like to take a moment to write down why this project got started and where I want it to go, just
so anyone who's new to it can get a sense of what's going on.
## I miss good pastebins.
Markdown rendering
It's finally here!
public
2 files
Don't worry, though! It's safe from <script>alert('evil attackers');</script> trying to do mean things.
Click the `Source` tab above to see what I mean!
fixup! catcher
pre-push git hook to catch "fixup!" commits
public
1 file
#![feature(process_exitcode_placeholder)]
extern crate git2;
use git2::{Repository, Oid};
use std::io::{Read, stdin};
use std::process::ExitCode;
fn pushees() -> Vec<Pushee> {
Store migration script
Use this to migrate your old store format to the new store format
public
1 file
# make backups!
# make sure psycopg2 is installed (pip install psycopg2)
# edit this to connect to your database
DATABASE_URL = 'postgres://paste@/paste'
# this script will move directories from your old store into a new store, both defined by the
# variables below.
OLD_STORE = 'old_store'
NEW_STORE = 'store'
public
1 file
/// Check if an email is valid.
///
/// This is a slightly-modified port of Firefox's input validation state machine.
///
/// This function explicitly allows single-character domain names, since some do exist.
fn check_email(email: &str) -> bool {
const ALLOWED: &[u8] = &[
b'.', b'!', b'#', b'$', b'%', b'&', b'\'', b'*', b'+', b'-',