Skip to content

Instantly share code, notes, and snippets.

@timvisee
timvisee / falsehoods-programming-time-list.md
Last active April 16, 2025 04:00
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@alyssais
alyssais / Brewfile
Last active August 17, 2017 15:25
Automatic Wordpress development environment setup using Homebrew (https://brew.sh), Composer (https://getcomposer.org), and Scripts to Rule Them All (https://githubengineering.com/scripts-to-rule-them-all/). Dashes in filenames represent directory separators. License CC0.
tap "homebrew/php"
brew "php71"
brew "mysql"
brew "composer"
@CAYdenberg
CAYdenberg / sow.md
Last active March 9, 2018 00:01
The latest version of my ‘killer contract’ for web designers and developers

Statement of Work

Between [company name]

And [customer name].

Summary:

We’ll always do our best to fulfill your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.

@huandu
huandu / nginx-cors.conf
Last active July 11, 2020 12:28 — forked from sbuzonas/nginx-cors.conf
Nginx CORS maps
map $http_origin $allow_origin {
default "$http_origin";
}
map $request_method $cors_method {
default "allowed";
"OPTIONS" "preflight";
}
map $cors_method $cors_max_age {
@andymatuschak
andymatuschak / States-v3.md
Last active April 14, 2025 22:47
A composable pattern for pure state machines with effects (draft v3)

A composable pattern for pure state machines with effects

State machines are everywhere in interactive systems, but they're rarely defined clearly and explicitly. Given some big blob of code including implicit state machines, which transitions are possible and under what conditions? What effects take place on what transitions?

There are existing design patterns for state machines, but all the patterns I've seen complect side effects with the structure of the state machine itself. Instances of these patterns are difficult to test without mocking, and they end up with more dependencies. Worse, the classic patterns compose poorly: hierarchical state machines are typically not straightforward extensions. The functional programming world has solutions, but they don't transpose neatly enough to be broadly usable in mainstream languages.

Here I present a composable pattern for pure state machiness with effects,

@parmentf
parmentf / GitCommitEmoji.md
Last active April 19, 2025 05:11
Git Commit message Emoji
@manigandham
manigandham / rich-text-html-editors.md
Last active April 16, 2025 18:28
Rich text / HTML editors and frameworks

Strictly Frameworks

Abstracted Editors

These use separate document structures instead of HTML, some are more modular libraries than full editors

@PurpleBooth
PurpleBooth / README-Template.md
Last active April 18, 2025 02:49
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@Zodiac1978
Zodiac1978 / .htaccess
Last active June 23, 2024 17:39
Safer WordPress with these .htaccess additions
# Don't show errors which contain full path diclosure (FPD)
# Use that line only if PHP is installed as a module and not per CGI
# try using a php.ini in that case.
# Change mod_php5.c to mod_php7.c if you are running PHP7
<IfModule mod_php5.c>
php_flag display_errors Off
</IfModule>
# Don't list directories
<IfModule mod_autoindex.c>
# This script work on any system using systemd as the init process.
# It works on Debian/Raspbian Jessie.
# If you have Debian/Rapbian Wheezy and want to use this script with systemd
# follow the information here : https://wiki.debian.org/systemd
# To easily download, install and set at startup:
# wget -O /tmp/download https://gist.github.com/Belphemur/3f6d3bf211b0e8a18d93/download && sudo tar -zxf /tmp/download --strip-components 1 -C /etc/systemd/system/ && sudo systemctl --reload-daemon && sudo systemctl enable Node-RED
# To consult the log : journalctl -u Node-RED
[Unit]