Skip to content

Instantly share code, notes, and snippets.

Mastering Programming - by Kent Beck

From years of watching master programmers, I have observed certain common patterns in their workflows. From years of coaching skilled journeyman programmers, I have observed the absence of those patterns. I have seen what a difference introducing the patterns can make. Here are ways effective programmers get the most out of their precious 3e9 seconds on the planet. The theme here is scaling your brain. The journeyman learns to solve bigger problems by solving more problems at once. The master learns to solve even bigger problems than that by solving fewer problems at once. Part of the wisdom is subdividing so that integrating the separate solutions will be a smaller problem than just solving them together.

Time

Slicing - Take a big project, cut it into thin slices, and rearrange the slices to suit your context. I can always slice projects finer and I can always find new permutations of the slices that meet different needs

@stanislaw
stanislaw / effective_modern_cmake.md
Created February 11, 2024 21:22 — forked from mbinna/effective_modern_cmake.md
Effective Modern CMake

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft

@stanislaw
stanislaw / sch_custom.c
Created July 31, 2023 13:46 — forked from jphickey/sch_custom.c
Simplified "custom" logic for CFS SCH applcation
/*
** $Id: sch_custom.c 1.3 2015/03/01 14:01:44EST sstrege Exp $
**
** Copyright 2007-2014 United States Government as represented by the
** Administrator of the National Aeronautics and Space Administration.
** All Other Rights Reserved.
**
** This software was created at NASA's Goddard Space Flight Center.
** This software is governed by the NASA Open Source Agreement and may be
** used, distributed and modified only pursuant to the terms of that
@stanislaw
stanislaw / splitpdf.py
Created July 26, 2020 10:34 — forked from AlexDenisov/splitpdf.py
Splits a PDF file for manual double-side printing
#!/usr/bin/env python3
import sys, os
from PyPDF2 import PdfFileReader, PdfFileWriter
inputname = sys.argv[1]
pdf = PdfFileReader(inputname)
numpages = pdf.getNumPages()
if numpages % 2 == 1:
numpages = numpages - 1
@stanislaw
stanislaw / wrapfigure_without_whitespace.tex
Created October 6, 2018 17:31 — forked from yig/wrapfigure_without_whitespace.tex
Eliminate white space around wrapfigure environments in LaTeX.
%% The typical answer for how to eliminate white space in wrapfigure doesn't work for me (I'm using a SIGGRAPH style sheet):
%% http://tex.stackexchange.com/questions/111393/too-much-space-around-wrap-figure
%% Instead, let's just offset the image.
%% The horizontal white space is \columnsep and the vertical white space is \intextsep.
%% Subtract them from the column width and offset the image accordingly.
%% How to move an image:
%% http://tex.stackexchange.com/questions/107340/how-to-shift-graphics-adjust-placement-of-figure-with-includegraphics
\begin{wrapfigure}[11]{R}{1in - .75\columnsep}
%\centering
\vspace{-\intextsep}
@stanislaw
stanislaw / Communicator.h
Created February 15, 2018 14:07 — forked from rjungemann/Communicator.h
How to open a TCP socket in Objective-C
#import <Foundation/Foundation.h>
@interface Communicator : NSObject <NSStreamDelegate> {
@public
NSString *host;
int port;
}
- (void)setup;
@stanislaw
stanislaw / runtime-class.m
Created February 14, 2018 16:42 — forked from mikeash/runtime-class.m
Creating a usable class purely at runtime using the Objective-C runtime APIs.
// clang -fobjc-arc -framework Foundation runtime-class.m
#import <Foundation/Foundation.h>
#import <objc/runtime.h>
@interface Person : NSObject
- (id)initWithFirstName: (NSString *)firstName lastName: (NSString *)lastName age: (NSUInteger)age;
@stanislaw
stanislaw / mutation_testing_implementation_notes.md
Created June 7, 2017 13:28 — forked from hcoles/mutation_testing_implementation_notes.md
So you want to build a mutation testing system

So you want to build a mutation testing system

Introduction

There have been a lot mutation testing systems, but very few have them have seen succesfull use in industry.

This document is a set of notes that might be helpful for anyone thinking of implementing a mutation testing system for another language.

It represents some of the things we learnt while creating pitest. The choices made by pitest are not neccessarily the best choices for your system. Some of these choices are appropriate only because of the particular quirks of Java and the JVM, and some of them are simply the first idea that we had.

#!/bin/sh
#
# Converts branch name 'MAPP-452_how-is-it-going' into a commit message 'MAPP-452 How is it going'
#
if ! [ -z $2 ]
then
if ! [ "message" == $2 ]
then
@stanislaw
stanislaw / gist:3e71034dc68dee774218c9e4f2c60830
Created September 14, 2016 14:27 — forked from ericallam/gist:11214298
Fixing animation snapback without setDisableActions:YES
// Implements the solution for solving "snapback" found in
// Chapter 8 of "iOS Core Animation Advanced Techniques" by Nick Lockwood
// without the need to use setDisableActions: to override the implicit animation,
// instead passing in the implicit animation key in addAnimation:forKey:
// With setDisableActions
- (void)applyBasicAnimation:(CABasicAnimation *)animation toLayer:(CALayer *)layer
{
//set the from value (using presentation layer if available)
animation.fromValue = [layer.presentationLayer ?: layer valueForKeyPath:animation.keyPath];