Skip to content

Instantly share code, notes, and snippets.

View kevboh's full-sized avatar

Kevin Barrett kevboh

View GitHub Profile
const execSync = require('child_process').execSync;
const spawnSync = require('child_process').spawnSync;
async function compile(input, context) {
// This is undocumented and could break.
let basePath = context.app.vault.adapter.basePath;
if (!basePath.endsWith("/")) {
basePath = basePath + "/";
}
@kevboh
kevboh / example.png
Last active April 18, 2024 13:59
CSS snippet for Obsidian to make my Longform projects look like a place I'd write in
example.png
@kevboh
kevboh / rollup.config.js
Last active June 29, 2021 13:41
rollup config for obsidian dev w/ svelte
import svelte from "rollup-plugin-svelte";
import typescript from "@rollup/plugin-typescript";
import { nodeResolve } from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import sveltePreprocess from "svelte-preprocess";
import copy from "rollup-plugin-copy";
import { env } from "process";
const isProd = env.BUILD === "production";
const isWatching = env.ROLLUP_WATCH === "true";
@kevboh
kevboh / case7.playground.swift
Last active January 23, 2024 03:00
Decoder for coded messages in Sherlock Holmes Consulting Detective (Jack the Ripper & West End) case 7, A Question of Identity
//: Decoder for coded messages in Sherlock Holmes Consulting Detective (Jack the Ripper & West End)
// case 7, A Question of Identity
// RUNNING THIS IS FOR SURE SPOILERS so maybe don't, you're probably smarter than I am and can do it without this <3
// To run in Xcode Playgrounds, dowload the file and remove the .swift extension.
import Foundation
let outer = "abcdefghijklmnopqrstuvwxyz".uppercased()
let inner = "aoepctqihjgfkbrylvdznxuwms".uppercased()

Keybase proof

I hereby claim:

  • I am kevboh on github.
  • I am kevboh (https://keybase.io/kevboh) on keybase.
  • I have a public key whose fingerprint is D3B2 7A14 BF5C 2803 8214 86FE 92D4 5D5E 0C26 CC4E

To claim this, I am signing this object:

@kevboh
kevboh / setup-statsd.sh
Created December 5, 2012 21:55 — forked from timmow/setup-statsd.sh
Turn an Ubuntu 12.04 EC2 into a StatsD/Graphite server
# update before doing anything
sudo apt-get update
# install git
sudo apt-get install g++ curl libssl-dev apache2-utils
sudo apt-get install git-core
sudo apt-get install nodejs
# install the Node package manager for later use
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
@kevboh
kevboh / NSString+KBAdditions.h
Created May 22, 2012 01:56
Making UILabel's adjustsFontSizeToFitWidth and minimumFontSize play nice with multi-lined labels
@interface NSString (KBAdditions)
- (CGFloat)fontSizeWithFont:(UIFont *)font constrainedToSize:(CGSize)size minimumFontSize:(CGFloat)minimumFontSize;
@end