Skip to content

Instantly share code, notes, and snippets.

@maxbeizer
maxbeizer / README.md
Created January 30, 2024 12:24 — forked from koshatul/README.md
use Apple Keychain to store GPG Passphrases

gpg-agent setup

Need to setup gpg-agent first, on OSX I use keychain (it also does ssh-agent)

$ brew info keychain
keychain: stable 2.8.5
User-friendly front-end to ssh-agent(1)
https://www.funtoo.org/Keychain
/usr/local/Cellar/keychain/2.8.5 (7 files, 108.5KB) *
@maxbeizer
maxbeizer / create-org-montage.sh
Created November 17, 2021 17:51 — forked from martinwoodward/create-org-montage.sh
Very quick ruby script to create a bash script that will create a montage of your org.
# Set OCTOKIT_ACCESS_TOKEN to authenticate with a PAT
# Something like OCTOKIT_ACCESS_TOKEN=<<TOKEN>> bundle exec ruby create-org-montage-script.rb
require "octokit"
Octokit.auto_paginate = true
# Replace <<ORG_NAME>> with your GitHub org
members = Octokit.org_members "<<ORG_NAME>>"
@maxbeizer
maxbeizer / result.ts
Created January 6, 2021 15:44 — forked from jsoendermann/result.ts
TypeScript Result type
interface IValue<T> {
type: 'value'
value: T
}
interface IError<E extends Error> {
type: 'error'
error: E
}
@maxbeizer
maxbeizer / script-template.sh
Created December 15, 2020 17:07 — forked from m-radzikowski/script-template.sh
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
#!/usr/bin/osascript
on run args
display notification (item 2 of args) with title (item 1 of args)
end

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

Centresource Pattern Library Guide

Below are elements that are expected to be in a Photoshop pattern library file.

Typography

  • Headers (h1 - h5)
  • Paragraphs
  • Lead Copy
  • Unordered List

With options -e, -n, -p, perl can do what grep/awk/sed can, what about ruby?

Let's take the result of ls -l as input and process it with ruby

grep with ruby

\ls -l | ruby -ne 'print if /^d/'

awk with ruby

\ls -l | ruby -ne 'puts split(/\s+/).last if /^d/'

/**********************************************/
/*
/* IR_Black Skin by Ben Truyman - 2011
/*
/* Based on Todd Werth's IR_Black:
/* http://blog.toddwerth.com/entries/2
/*
/* Inspired by Darcy Clarke's blog post:
/* http://darcyclarke.me/design/skin-your-chrome-inspector/
/*
UPDATE wp_options SET option_value = replace(option_value, 'OLD_SITE_URL', 'NEW_SITE_URL') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'OLD_SITE_URL','NEW_SITE_URL');
UPDATE wp_posts SET post_content = replace(post_content, 'OLD_SITE_URL', 'NEW_SITE_URL');
UPDATE wp_postmeta SET meta_value = replace(meta_value, 'OLD_SITE_URL', 'NEW_SITE_URL');