Skip to content

Instantly share code, notes, and snippets.

View michaelfox's full-sized avatar
🦊

Michael Fox michaelfox

🦊
  • Kirschbaum Development Group
View GitHub Profile
@RobTrew
RobTrew / dtSheetMMDPrettyPrinted.js
Last active October 3, 2022 18:22
Selected DEVONthink Sheet -> DEVONthink markdown record (pretty-printed MMD table)
((options) => {
'use strict';
// (NB JavaScript for Automation – JXA: Save as .scpt )
// Selected DEVONthink Sheet -> DEVONthink markdown record (MMD table)
// (New record containing MMD table created is same group as selection)
// Uses original fileName stem, with '.md' appended.
// This is the *whitespace pretty-printed* version
@jarektkaczyk
jarektkaczyk / config.php
Last active February 23, 2023 03:26
Laravel - tinker like a boss (with PsySH)
<?php // ~/.config/psysh/config.php
// Anything not Laravel - let's try to autoload something likely to exist
if (!defined('LARAVEL_START')) {
return [
'defaultIncludes' => [
getcwd().'/vendor/autoload.php',
getcwd().'/bootstrap/autoload.php',
],
];
@ttscoff
ttscoff / csv-to-mmd-tables.rb
Last active December 1, 2017 02:18
A messy script for converting simple CSV syntax to MultiMarkdown tables, for use in the Markdown Service Tools <http://brettterpstra.com/projects/markdown-service-tools/>
#!/usr/bin/env ruby
require 'csv'
# md - Tables - Create from CSV
# v1.1 2016-08-17
# From the Markdown Service Tools <http://brettterpstra.com/projects/markdown-service-tools/>
# Converts CSV style input to MultiMarkdown tables
# Changelog
# 1.1: Fixed error when line ended with whitespace in middle of input
@vasanthk
vasanthk / System Design.md
Last active April 19, 2024 15:40
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@ttscoff
ttscoff / sharetabs.rb
Created September 4, 2015 18:44
Browser tabs to Dropbox HTML list
# Share Tab Collection 1.0 | Brett Terpstra 2015 <http://brettterpstra.com>
USERID = 'XXXXX'
require 'shellwords'
require 'fileutils'
def class_exists?(class_name)
klass = Module.const_get(class_name)
@solidsnack
solidsnack / syslogged
Created July 26, 2013 18:08
Wrapper for logging any command's STDOUT and STDERR to syslog.
#!/bin/bash
set -o errexit -o nounset -o pipefail
function -h {
cat <<EOF
USAGE: syslogged <program> <args>
Wraps a command invocation with logging, sending STDOUT and STDERR to
syslog, setting the syslog tag to:
<program>[<pid>]
@tjluoma
tjluoma / search-in-1password
Last active August 23, 2017 01:00
Bookmarklet to open a JavaScript prompt, pre-filled with the current domain, and then send it to 1Password for iOS 4.1
javascript:str=window.location.hostname;n=str.split(".");l=n.length;op=window.prompt('Search in 1Password',n[(l-2)]+"."+n[(l-1)]);if(op!=null){window.location='onepassword://search/'+op;}
@ttscoff
ttscoff / private.xml
Created December 8, 2012 19:00
KeyRemap4MacBook XML for hyper key, mix with PCKeyBoardHack to turn Caps Lock key into something useful
<?xml version="1.0"?>
<root>
<item>
<name>F19 to F19</name>
<appendix>(F19 to Hyper (ctrl+shift+cmd+opt) + F19 Only, send escape)</appendix>
<identifier>private.f192f19_escape</identifier>
<autogen>
--KeyOverlaidModifier--
KeyCode::F19,
KeyCode::COMMAND_L,
@simonwhitaker
simonwhitaker / ssl_expiry.sh
Created November 30, 2012 22:27
Get the expiry date of a secure website's SSL certificate at the command line
#!/bin/sh
ssl_expiry() {
# Show usage info if not called with a hostname
if [ $# -eq 0 ]; then
echo "Usage: ssl_expiry HOSTNAME"
return 0
fi
domain=$1