Skip to content

Instantly share code, notes, and snippets.

View dideler's full-sized avatar

Dennis Ideler dideler

View GitHub Profile
@dideler
dideler / overcommitment.md
Last active January 6, 2024 15:11
Avoid over-commitment

Avoid over-commitment

It takes a few minutes to entangle yourself in commitments that can take years to unwind.

Learn when and how to say "no."

If you're over-committed, say, "I'd really like to take on that task/role, but I'm concerned that with my current commitments, I might not be able to perform the task to the high standards to which I hold myself."

Before you say "yes" to anything, sleep on it.

@dideler
dideler / file_to_string.py
Created March 21, 2013 22:17
Playing around with different ways to read file contents into a string.
#!/usr/bin/env python
import sys
filename = sys.argv[1]
# These do not remove \n
with open(filename) as f:
s = ''.join(f.readlines())
@dideler
dideler / example.md
Last active February 17, 2024 20:24
A python script for extracting email addresses from text files.You can pass it multiple files. It prints the email addresses to stdout, one address per line.For ease of use, remove the .py extension and place it in your $PATH (e.g. /usr/local/bin/) to run it like a built-in command.

The program below can take one or more plain text files as input. It works with python2 and python3.

Let's say we have two files that may contain email addresses:

  1. file_a.txt
foo bar
ok ideler.dennis@gmail.com sup
 hey...user+123@example.com,wyd
hello world!
@dideler
dideler / Makefile
Last active April 8, 2024 04:16
An easy and quick way to encrypt (and decrypt) sensitive files on your computer. The filename is static, so don't forget to set it (on line 14)!
# Based on http://ejohn.org/blog/keeping-passwords-in-source-control/
#
# John Resig needed a way to keep sensitive data (e.g. config files with
# passwords) out of source control. So he decided to encrypt the sensitive data.
#
# I decided to modify the script so it's purpose is quickly encrypting or
# decrypting any sensitive file you have on your computer.
#
# Usage: make encrypt
# make decrypt
@dideler
dideler / _code_snippets.md
Last active January 6, 2024 15:11
Various snippets of code. Enjoy!

Snippets of code that I've played around with, which could be useful to others.
Nothing impressive, but you may learn a thing or two.

@dideler
dideler / inheritance.cpp
Last active March 20, 2017 21:13
C++ notes
class A
{
public:
int x;
protected:
int y;
private:
int z;
};
@dideler
dideler / 0-startup-overview.md
Last active May 3, 2024 11:03
Startup Engineering notes
@dideler
dideler / fish.tpp
Last active April 24, 2019 08:04
My presentation for @softwareniagara's DevTricks event. My topic was the friendly interactive shell, aka fish. Slides are made with Text Presentation Program (TPP). View the slides in all their glory using the command `tpp fish.tpp`. You can view a recording (that I made at home) here: http://youtu.be/SWmKfb2jQhU
--title The Friendly Interactive Shell (fish)
--author Dennis Ideler | @dideler | ideler.dennis@gmail.com
--date Prepared for Software Niagara's DevTricks | June 25, 2013
--footer dennisideler.com
--## 'today' is a date option, but kinda useless.
--## heading and title seem to do the same thing.
--horline
--##withborder
--fgcolor black
--bgcolor white
@dideler
dideler / code_review_checklists.md
Last active March 18, 2024 07:35
Code review checklists. Leave your suggestions in a comment below!

Based on the article: Using checklists for code review

In general, people are pretty good at the code review process, but it's sometimes surprising what can slip through. A natural consequence of the way our brains look at the world is that it's easy to pay a lot of attention to small details and code style flubs, and completely miss the big picture.

Obviously, not everything is applicable for every change. If the review request isn't making any changes to UI, then skip the first two checklists entirely. If a change is a bug fix, typically don't review it for architecture and design principles.

Put the big stuff first (e.g. architecture). You don't want to work through a ton of small issues before realizing that everything has to be rewritten.

Do a pass through the code for each and every item in the checklist. By only looking for a very specific type of defect, each pass goes relatively quickly, even for large changes. Focu

@dideler
dideler / screenwriting.md
Last active January 6, 2024 15:11
Save the Cat! - Beat Sheet

A formula that lays out, on a page-by-page basis, exactly what should happen when, in a screenplay.
Each page is roughly equivalent to a minute of screen time.
Page counts don’t need to be followed strictly, but it’s important to get the proportions fairly close.

Opening image (p. 1)
Sets the tone for the story and suggests the protagonist’s primary problem.
Theme is stated (p. 5)
A question or statement, usually made to the protagonist, indicating the story’s main thematic idea.