Skip to content

Instantly share code, notes, and snippets.

View atelierbram's full-sized avatar

Bram de Haan atelierbram

View GitHub Profile
@atelierbram
atelierbram / how-to-setup-homebrew-apache-php-mariadb-on-macos.md
Last active February 2, 2024 12:48
How to setup Homebrew, Apache, PHP and MariaDB on macOS

How to setup Homebrew, Apache, PHP and MariaDB on macOS

This guide is intended to assist you in maintaining an up-to-date development environment for macOS using the latest versions of Homebrew, Apache, PHP, and MariaDB.

Make a backup of your computer, but also think about exporting databases of your projects in .sql files from PhpMyAdmin.

XCode Command Line Tools

If you don't already have XCode installed, it's best to first install the command line tools as these will be used by homebrew:

@atelierbram
atelierbram / include.md
Last active January 28, 2024 18:16
WordPress maintenance - minimal setup

If maintenance.php is in a folder called inc within the WordPress theme folder, then include this code at the top of the header.php file of the theme:

  require_once get_stylesheet_directory() . '/inc/maintenance.php';

Everyone not logged in visiting the website will get the message.

@atelierbram
atelierbram / convert-markdown-to-html-css-with-pandoc.md
Created April 2, 2017 10:46
Convert markdown files to html with Pandoc

Convert Markdown to html+css with Pandoc

Convert single markdown file to html from commandline:

  pandoc -f markdown -t html5 -o output.html input.md -c style.css

Convert multiple markdown files

@atelierbram
atelierbram / make-git-store-the-username-and-password.md
Created November 28, 2023 16:26
Make Git store the username and password
  git config --global credential.helper store
@atelierbram
atelierbram / npm-install-dependencies.sh
Last active November 19, 2023 14:39
Fast install dependencies for npm
#!/bin/bash -x
{
npm install @rollup/plugin-terser chokidar-cli npm-run-all recursive-fs rollup sass --save-dev
}
@atelierbram
atelierbram / minify-html-output.php
Last active November 18, 2023 13:18
PHP Function to Minify HTML Output
<?php
// start the output buffer
ob_start('compress_page');
?>
<!-- all html content here -->
<?php
// end the buffer, echo the page content
ob_end_flush();
// function that gets rid of tabs, line breaks, and extra spaces
@atelierbram
atelierbram / create-a-persistent-directory-stack-in-zsh.md
Last active October 31, 2023 16:58
Create a persistent directory stack in zsh
@atelierbram
atelierbram / reset.css
Last active October 20, 2023 06:42 — forked from iegik/reset.css
CSS Typography reset
html, body, div, span, applet, object, iframe, table, caption,
tbody, tfoot, thead, tr, th, td, del, dfn, em, font, img, ins,
kbd, q, s, samp, small, strike, strong, sub, sup, tt, var,
h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr,
acronym, address, big, cite, code, dl, dt, dd, ol, ul, li,
fieldset, form, label, legend {
vertical-align: baseline;
font-family: inherit;
font-weight: inherit;
font-style: inherit;
@atelierbram
atelierbram / accordion-step-javascript.markdown
Created September 27, 2023 09:39
accordion: step javascript
@atelierbram
atelierbram / test.sh
Created September 10, 2023 19:25
Checking syntax highlighting Base2Tone for bash files in VS-Code
#!/usr/bin/env bash
do_something() {
grep --help | grep '\-i'
grep --help | grep -e -i
grep --help | grep -- -i
}