Skip to content

Instantly share code, notes, and snippets.

@HairAndBeardGuy
HairAndBeardGuy / falsehoods-programming-time-list.md
Created August 1, 2023 15:19 — forked from timvisee/falsehoods-programming-time-list.md
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).
@HairAndBeardGuy
HairAndBeardGuy / wp-config.php
Created October 7, 2022 18:21 — forked from MikeNGarrett/wp-config.php
All those damned wp-config constants you can never remember.
<?php
// PHP memory limit for this site
define( 'WP_MEMORY_LIMIT', '128M' );
define( 'WP_MAX_MEMORY_LIMIT', '256M' ); // Increase admin-side memory limit.
// Database
define( 'WP_ALLOW_REPAIR', true ); // Allow WordPress to automatically repair your database.
define( 'DO_NOT_UPGRADE_GLOBAL_TABLES', true ); // Don't make database upgrades on global tables (like users)
// Explicitely setting url
@HairAndBeardGuy
HairAndBeardGuy / apache_ssl.md
Created April 15, 2020 09:54 — forked from GAS85/apache_ssl.md
Apache 2.4.18 + Letsencrypt + Ubuntu 18.04 - SSL config for A+ on SSLLabs.com

Prerequisites

  • Ubuntu 18.04 (16.04 works the same)
  • Apache 2.4.18 or higher
  • OpenSSL 1.0.2g-1ubuntu4.10 or higher
  • e.g. LetsEncrypt certificate
OS: Ubuntu 18.04 Apache/2.4.18 1.0.2g-1ubuntu4.10
@HairAndBeardGuy
HairAndBeardGuy / README.md
Created January 30, 2020 23:16 — forked from nikcub/README.md
Facebook PHP Source Code from August 2007
@HairAndBeardGuy
HairAndBeardGuy / v9-voice-receive.js
Created April 24, 2019 00:54
Discord.js V9 Voice Recorder
const Discord = require("discord.js");
const fs = require('fs');
const client = new Discord.Client();
const config = require('./auth.json');
// make a new stream for each time someone starts to talk
function generateOutputFile(channel, member) {
// use IDs instead of username cause some people have stupid emojis in their name

Extension for Google Chrome:

Pragma Header - Chrome Web Store

Akamai Pragma Headers:

akamai-x-cache-on, akamai-x-cache-remote-on, akamai-x-check-cacheable, akamai-x-get-cache-key, akamai-x-get-extracted-values, akamai-x-get-nonces, akamai-x-get-ssl-client-session-id, akamai-x-get-true-cache-key, akamai-x-serial-no, akamai-x-get-request-id, akamai-x-request-trace, akamai-x--meta-trace, akama-xi-get-extracted-values,

@HairAndBeardGuy
HairAndBeardGuy / caddy-upstart-install.sh
Created July 15, 2017 13:34
Install Caddy Server on Ubuntu 14.04 with Upstart
apt install curl
curl https://getcaddy.com | bash -s cors,expires,filemanager,git,hugo,ipfilter,jsonp,jwt,locale,mailout,minify,multipass,prometheus,ratelimit,realip,search,upload
chown root:root /usr/local/bin/caddy
chmod 755 /usr/local/bin/caddy
setcap 'cap_net_bind_service=+ep' /usr/local/bin/caddy
mkdir /etc/caddy
chown -R root:www-data /etc/caddy
mkdir /etc/ssl/caddy
chown -R www-data:root /etc/ssl/caddy
chmod 0770 /etc/ssl/caddy
@HairAndBeardGuy
HairAndBeardGuy / caddy.sh
Last active April 18, 2017 21:58 — forked from Jamesits/caddy.sh
Install Caddy Server on Ubuntu
apt install curl
curl https://getcaddy.com | bash -s cors,expires,filemanager,git,hugo,ipfilter,jsonp,jwt,locale,mailout,minify,multipass,prometheus,ratelimit,realip,search,upload
chown root:root /usr/local/bin/caddy
chmod 755 /usr/local/bin/caddy
setcap 'cap_net_bind_service=+ep' /usr/local/bin/caddy
mkdir /etc/caddy
chown -R root:www-data /etc/caddy
mkdir /etc/ssl/caddy
chown -R www-data:root /etc/ssl/caddy
chmod 0770 /etc/ssl/caddy
@HairAndBeardGuy
HairAndBeardGuy / OpenWithSublimeText3.bat
Created January 10, 2016 15:03 — forked from roundand/OpenWithSublimeText3.bat
Open folders and files with Sublime Text 3 from windows explorer context menu (tested in Windows 7)
@echo off
SET st3Path=C:\Program Files (x86)\Sublime Text 3\sublime_text.exe
rem add it for all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%st3Path%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st3Path% \"%%1\"" /f
rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
@HairAndBeardGuy
HairAndBeardGuy / css_resources.md
Last active August 29, 2015 14:17 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides