Skip to content

Instantly share code, notes, and snippets.

View tanner-west's full-sized avatar

Tanner West tanner-west

View GitHub Profile
@tanner-west
tanner-west / list-widget.php
Created May 27, 2020 16:09
The Events Calendar Custom Widget
<?php
/**
* Events List Widget Template
* This is the template for the output of the events list widget.
* All the items are turned on and off through the widget admin.
* There is currently no default styling, which is needed.
*
* This view contains the filters required to create an effective events list widget view.
*
* You can recreate an ENTIRELY new events list widget view by doing a template override,

HTTPS to HTTPS 301 Redirects with GoDaddy: Impossible

We had a client who needed to redirect an entire domain (we'll call it firstdomain.com) to a specific page on another domain (seconddomain.com/path/to/content) No problem, we thought. Their DNS was handled with GoDaddy, who offers a no-charge 301 forwarding service. A colleague of mine set up the redirect the way you'd expect, with all traffic to firstdomain.com being redirected to https://seconddomain.com/path/to/content. Then we encountered a problem.

We started getting ERR_CERT_COMMON_NAME_INVALID errors when we tried to visit firstdomain.com in desktop browsers. No redirect occurred. Some, but not all mobile browsers didn't have this issue. Stepping back to examine the problem, two mysteries became apparent to me:

  1. How does GoDaddy actually send a 301 status? You need a HTTP server for that.
  2. What is the purpose of the mysterious A record in the domain's DNS records that point to 184.168.131.241?

The mysterious A record in question was not ed

function* myGeneratorFunction(){
console.log("Hello generator!")
yield "Yield result one"
console.log("Hello generator again!")
yield "Yield result two"
return "Generator is done"
}
function getTwoPlusTwo() {
return 2 + 2
}
function* mathSaga() {
const sum = yield getTwoPlusTwo()
console.log("two plus two equals: ", sum)
const sum2 = yield call(getTwoPlusTwo)
console.log("two plus two again equals: ", sum2)
function getTwoPlusTwo() {
return 2 + 2
}
function* myGeneratorFunction() {
const sum = yield getTwoPlusTwo()
console.log("two plus two equals: ", sum)
}
const g = myGeneratorFunction();
function getTwoPlusTwo() {
return 2 + 2
}
function* myGeneratorFunction() {
const sum = yield getTwoPlusTwo()
console.log("two plus two equals: ", sum)
}
const g = myGeneratorFunction();
function getTwoPlusTwo() {
return 2 + 2;
}
function* myGeneratorFunction() {
const sum = yield getTwoPlusTwo();
console.log("two plus two equals: ", sum);
}
const g = myGeneratorFunction();
{
"@@redux-saga/IO": true,
"combinator": false,
"type": "PUT",
"payload": {
"action": {
"type": "GET_USERS_SUCCEEDED",
"payload": [
{
"name": "Bob",
function getUsersAsync() {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve([{ name: "Bob", age: 24 }, { name: "Alice", age: 50 }])
}, 3000)
})
}
export function* getUsersSaga() {
try {
const myButton = wrapper.findWhere((node) =>
node.prop('accessibilityLabel') === "my-button")