Skip to content

Instantly share code, notes, and snippets.

View duaneleem's full-sized avatar
Converting Coffee to Code, Daily

Duane Leem duaneleem

Converting Coffee to Code, Daily
View GitHub Profile
@duaneleem
duaneleem / .htaccess
Last active January 20, 2018 06:11
Used to create a development (or production) environment of WordPress using the official Docker WP from the store. One huge plus to this if you decide to use it for development, check out the .htaccess file. It rewrites requests to the /wp-content/uploads folder so you don't have to add that to your dev environment :) I opened the MySQL port to …
# ================================================================================
# Redirects uploads to production.
# ================================================================================
<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^wp-content/uploads/(.*)$ https://www.some-website.com/wp-content/uploads/$1 [R=301,NC,L]
</IfModule>
# ================================================================================
@duaneleem
duaneleem / Contract Killer 3.md
Created January 20, 2018 05:56
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

@duaneleem
duaneleem / example.ts
Created January 20, 2018 05:52
Documentation example.
/** Class representing a point. */
class Point {
/**
* Create a point.
* @param {number} x - The x value.
* @param {number} y - The y value.
*/
constructor(x, y) {
// ...
}
@duaneleem
duaneleem / docker-compose.yml
Created January 17, 2018 17:59
This is used to create a local WordPress development using Docker + .htaccess (which is at DuaneLeem.com)
version: '3'
services:
db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
ports:
- "3406:3306"
restart: always
@duaneleem
duaneleem / aws-lambda.js
Created November 13, 2017 22:10 — forked from MrRoyce/gist:097edc0de2fe001288be2e8633f4b22a
AWS CodeDeploy Lamda formatter for Slack messages - node.js
var services = '/services/...'; // Update this with your Slack service...
var channel = "#aws-deployments" // And this with the Slack channel
var https = require('https');
var util = require('util');
var formatFields = function(string) {
var
message = JSON.parse(string),
fields = [],
@duaneleem
duaneleem / dentrix-chart.bat
Last active September 24, 2017 17:58
Dentrix G5 script to fix slow chart loads. Run this AFTER renaming/deleting C:\Program Files (x86)\Dentrix\Cust\Chart.Startup
::Make sure registry commands are not disabled or windows is damaged
reg /?
if errorlevel 1 (
GOTO SYSTEMREPAIR
)
if errorlevel 0 (
GOTO HI
)
@duaneleem
duaneleem / example.ts
Created September 13, 2017 17:53
Code Documentation
/** Class representing a point. */
class Point {
/**
* Create a point.
* @param {number} x - The x value.
* @param {number} y - The y value.
*/
constructor(x, y) {
// ...
}
@duaneleem
duaneleem / example.ts
Created September 13, 2017 17:51
Try/Catch example.
export class TryCatchExample {
mtdExample() {
try {
for (editIndex = 0; editIndex < partner.objProjects.length; editIndex++)
{
if (partner.objProjects[editIndex].id == req.body.projectId) {found = true; break;}
}
if (!found)
{
@duaneleem
duaneleem / example.ts
Last active January 20, 2018 05:45
Typescript Class Example
export class Example {
private strVariable: string;
constructor() {
// Something to do during init.
}
mtdNothing = (): string => {
return "I'm returning nothing.";
} // mtdNothing()
@duaneleem
duaneleem / 0_reuse_code.js
Created June 20, 2017 14:04
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console