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 / install-tmux.sh
Last active November 10, 2021 19:49 — forked from muralisc/install-tmux.sh
Install tmux 3.0a on Amazon Linux 2 / rhel /centos
# Install tmux 3.0a on Amazon Linux 2
# Originally tailored for CentOS 7
# install deps
sudo yum install -y gcc kernel-devel make ncurses-devel
## Needs openssl
sudo yum install openssl-devel
# DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL
## Install
<iframe src="https://www.facebook.com/plugins/page.php?href=https%3A%2F%2Fwww.facebook.com%2Ftoastmasterscreatingcommunicators&tabs=timeline&width=700px&height=500&small_header=true&adapt_container_width=true&hide_cover=false&show_facepile=true&appId=1808361502709557" width="700px" height="500" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowfullscreen="true" allow="autoplay; clipboard-write; encrypted-media; picture-in-picture; web-share"></iframe>
@duaneleem
duaneleem / kube-remove.sh
Created September 30, 2019 21:04
Remove K8s on Ubuntu 16
kubeadm reset
sudo apt-get purge kubeadm kubectl kubelet kubernetes-cni kube*
sudo apt-get autoremove
sudo rm -rf ~/.kube
@duaneleem
duaneleem / clickfunnels.html
Created August 17, 2019 08:06
ClickFunnels Province / Country / State
<script type="text/html" id="cfx_all_canada">
<option value="">Select Province</option>
<option value="">------------------------------</option>
<option value="AB">Alberta</option>
<option value="BC">British Columbia</option>
<option value="MB">Manitoba</option>
<option value="NB">New Brunswick</option>
<option value="NL">Newfoundland and Labrador</option>
<option value="NS">Nova Scotia</option>
<option value="ON">Ontario</option>
@duaneleem
duaneleem / .htaccess
Last active November 12, 2018 03:04
Immutable WordPress Example. Visit the following for further information: https://blog.duaneleem.com/immutable-wordpress-example/
# ================================================================================
# Redirects uploads to production.
# ================================================================================
<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^wp-content/uploads/(.*)$ https://www.someotherdomain.com/wp-content/uploads/$1 [R=301,NC,L]
</IfModule>
# ================================================================================
@duaneleem
duaneleem / HashRouter.js
Last active September 11, 2018 06:59
Example of our HashRouter is used in React. Great for static hosting services such as GitHub Pages.
<HashRouter>
<div>
<Route path="/" component={Home} />
<Route path="about" component={About} />
<Route path="teachers" component={Teachers} />
<Route path="courses" component={Courses} />
</div>
</HashRouter>
@duaneleem
duaneleem / page-private.php
Created April 11, 2018 19:06
WordPress private page.
<?php
/**
* This template is used for displaying PRIVATE pages.
*
* Template Name: Private: Full Width
*/
get_header(); ?>
<div class="wrapper section medium-padding">
@duaneleem
duaneleem / add-year.js
Created March 30, 2018 22:56
Adds a year to the current year.
/**
* @param {string} currentDate - The current date.
* @returns {string} Returns the new expiration date.
*/
private addYear = (currentDate: string): string => {
// Add a day to the current date.
let objDate = new Date(currentDate);
objDate.setDate(objDate.getDate() + 1);
// Format the month.
@duaneleem
duaneleem / example.diray.20180307.js
Last active March 7, 2018 20:16
Example output for Diray 20180213
var rm_trans = {
affiliateConfig: {ranMID: '42785', discountType: 'item'},
orderid: '2072',
currency: 'USD',
customerStatus: 'CUSTOMER_STATUS',
conversionType: 'Sale',
customerID: '0',
discountCode: 'upfree2, test2, test3',
discountAmount: 39.28,
taxAmount: 0,
@duaneleem
duaneleem / .conf
Last active February 11, 2018 21:19
WordPress Assets Loaded from Production
# Send all uploads links to production.
location ^~ /wp-content/uploads {
rewrite ^/wp-content/uploads/(.*)$ https://www.duaneleem.com/wp-content/uploads/$1 permanent;
}