Skip to content

Instantly share code, notes, and snippets.

sts10 / kitty.conf
Created Jan 16, 2020
My config file for Kitty Terminal Emulator
View kitty.conf
# vim:fileencoding=utf-8:ft=conf:foldmethod=marker
#: Fonts {{{
#: kitty has very powerful font management. You can configure
#: individual font faces and even specify special fonts for particular
#: characters.
font_family JetBrains Mono Medium
bold_font JetBrains Mono Bold
sts10 / init.vim
Created Jan 7, 2020
One init.vim for both Mac and Linux
View init.vim
" call plug#begin('~/.vim/plugged')
call plug#begin('~/.config/nvim/plugged')
" Basics
Plug 'tpope/vim-commentary'
Plug 'sickill/vim-pasta'
Plug 'justinmk/vim-sneak'
Plug 'ervandew/supertab'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-repeat'
sts10 /
Last active May 9, 2019
Rust script defining function that can write either to Terminal or a file
use std::fs::File;
use std::io::{self, Write};
pub enum Destination<'a> {
File(&'a std::fs::File),
fn main() {
print_report(Destination::Terminal).expect("Error printing report to terminal");
sts10 /
Created Apr 11, 2019
Playing with Digits kata
// status: Getting a multiply overflow werror when I "Attempt"
fn dig_pow(n: i64, p: i32) -> i64 {
let digits: Vec<_> = n.to_string().chars().map(|d| d.to_digit(10).unwrap()).collect();
let mut sum: u64 = 0;
let mut i: u32 = 0;
for digit in digits {
sts10 / alacritty.yml
Last active Jun 14, 2020
My Alacritty config yml for MacOS (compliant with v 0.4.1-dev)
View alacritty.yml
# Configuration for Alacritty, the GPU enhanced terminal emulator
# Any items in the `env` entry below will be added as
# environment variables. Some entries may override variables
# set by alacritty it self.
# TERM env customization.
# If this property is not set, alacritty will set it to xterm-256color.
sts10 /
Created Dec 5, 2018
my not-working day 4 part 1 solution (Advent of Code 2018)
use std::collections::HashMap;
use std::fs::File;
use std::io;
use std::io::BufRead;
use std::io::BufReader;
use std::str::FromStr;
fn main() {
let mut events_vec: Vec<String> = read_by_line("inputs/day04-test.txt").unwrap();
sts10 / pyenv.markdown
Last active Jul 11, 2019
Installing and setting up a decent Python configuration in MacOS
View pyenv.markdown

Installing and setting up a decent Python configuration in MacOS 10.11

Before I took these steps, I ran brew uninstall python in an attempt to clear out a different Python installation. I also had to clear out some stuff in my .bash_profile.

  1. Install Pyenv via Homebrew: brew update && brew install pyenv
  2. Add stuff to .bash_profile: echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.bash_profile
  3. Restart terminal.
  4. Maybe install dependencies? (You may be good to go already.)
  5. pyenv install --list and pick new-ish-but-stable versions of python2 and python3 to install. For example: pyenv install 3.7.0 2.7.15
  6. You can set version 3 as the global, with 2 as fall-back: pyenv global 3.7.0 2.7.15. You can also set your system's Python as a secondary fallback by running pyenv global 3.7.0 2.7.15 system.
sts10 / masto_following_updater.rb
Last active Oct 25, 2018
A Ruby script that's (trying to) find moved accounts for you to follow
View masto_following_updater.rb
require 'mastodon'
require 'csv'
puts "Welcome to the Mastodon Following Updater!"
puts "\n"
puts "First, enter the URL of your home instance. For example, or"
base_url = gets.chomp
sts10 / yubikey-gpg-question.markdown
Last active Feb 8, 2018
Question about OpenPGP and YubiKey
View yubikey-gpg-question.markdown

Below is a step-by-step guide to test whether I could get a secret PGP key off of my YubiKey.

  1. On Computer 1, generate a GPG key pair.
  2. More your secret key to a YubiKey, following the instructions on this wedpage under "Generating the key on your local system"
  3. On computer 2, import the public key of the key pair.
  4. Still on computer 2, insert your YubiKey. Then create a stub for the secret key by running gpg --card-status source
  5. Unplug YubiKey.
  6. On computer 2, run gpg --export-secret-keys -a KEYID > secret.asc, filling in the KEYID with the key id.
  7. A private key is now in the file secret.asc
sts10 /
Last active Dec 4, 2017 — forked from anonymous/
Advent of Code 2017 Day 3, part 1
fn main() {
println!("Ring number for 12 is {}", get_ring_number(12));
println!("distance to closest railroad for 12 is {}", find_distance_to_closest_railroad(12));
println!("total steps for 12 is {}", find_distance_to_closest_railroad(12) + get_ring_number(12));
println!("total steps for 23 is {}", find_distance_to_closest_railroad(23) + get_ring_number(23));
println!("total steps for 1024 is {}", find_distance_to_closest_railroad(1024) + get_ring_number(1024));
println!("total steps for 347991 is {}", find_distance_to_closest_railroad(347991) + get_ring_number(347991));
You can’t perform that action at this time.