Skip to content

Instantly share code, notes, and snippets.

@jdunne
jdunne / product-management.md
Last active October 12, 2021 02:29
Product Management
@jdunne
jdunne / productivity.md
Created September 15, 2021 13:32
Plain Text Productivity System

Plain Text Productivity System

Goals

  • Everything should be in plain text, using the markdown format, to ensure maximum portability.
  • The style should mimic bullet journal to and it easy to import written notes.
  • Files should live in cloud drive, like Dropbox or OneDrive.
  • Grep-ability.

Structure

Files are created for each day and placed into a directory that corresponds to the year.

commands = {}
def command(function):
commands[function.__name__] = function
@command
def us_command(context):
print("us_command - " + str(context))
@command

Keybase proof

I hereby claim:

  • I am jdunne on github.
  • I am johndunne (https://keybase.io/johndunne) on keybase.
  • I have a public key ASCXNWFChX7jLC1xxZIG3UiFVhXwqs2RdlVdq7SvrBDpYAo

To claim this, I am signing this object:

@jdunne
jdunne / anagram.py
Created August 5, 2017 02:23
Anagram Finder
"""
anagram.py - Finds anagrams in stdin.
"""
import sys
import collections
anagrams = collections.defaultdict(list)
for line in sys.stdin:
word = line.rstrip()
// One solution is to pass a default value into the method.
string uri = configFile.GetValueOrDefault(“serviceUri”,
“http://example.com/service");
ConnectToService(uri);
// Another possibility is to introduce a Maybe type to hold the return value.
Maybe<string> uri = configFile.GetValue(“serviceUri”); 
if(uri.HasValue)
{
ConnectToService(uri.HasValue ?
string uri = configFile.GetValue(“serviceUri”); 
if(uri == null)
{
  uri = “http://example.com/service";
}
ConnectToService(uri);
class Service
{
class NullAuditor : IAuditor
  {
  void RecordThatSomethingWasDone()
  {
  // does nothing
  }
  }
class Service
{
public void DoSomething(IAuditor auditor = null)
  {
  // do something…
  if(auditor != null)
  {
  auditor.RecordThatSomethingWasDone();
  }
  }
class Service
{
private readonly IAuditor _defaultAuditor = new StandardAuditor();
public void DoSomething()
  {
  DoSomething(_defaultAuditor);
  }
public void DoSomething(IAuditor auditor)