Skip to content

Instantly share code, notes, and snippets.

Avatar
Converting Coffee to Code, Daily

Duane Leem duaneleem

Converting Coffee to Code, Daily
View GitHub Profile
@duaneleem
duaneleem / install-tmux.sh
Last active Nov 10, 2021 — forked from muralisc/install-tmux.sh
Install tmux 3.0a on Amazon Linux 2 / rhel /centos
View install-tmux.sh
# 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
View tm-creatingcommunicators.html
<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 Sep 30, 2019
Remove K8s on Ubuntu 16
View kube-remove.sh
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 Aug 17, 2019
ClickFunnels Province / Country / State
View clickfunnels.html
<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 Nov 12, 2018
Immutable WordPress Example. Visit the following for further information: https://blog.duaneleem.com/immutable-wordpress-example/
View .htaccess
# ================================================================================
# 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 Sep 11, 2018
Example of our HashRouter is used in React. Great for static hosting services such as GitHub Pages.
View HashRouter.js
<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 Apr 11, 2018
WordPress private page.
View page-private.php
<?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 Mar 30, 2018
Adds a year to the current year.
View add-year.js
/**
* @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 Mar 7, 2018
Example output for Diray 20180213
View example.diray.20180307.js
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 Feb 11, 2018
WordPress Assets Loaded from Production
View .conf
# Send all uploads links to production.
location ^~ /wp-content/uploads {
rewrite ^/wp-content/uploads/(.*)$ https://www.duaneleem.com/wp-content/uploads/$1 permanent;
}