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,
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();
{
"@@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 {
function getTwoPlusTwo() {
return 2 + 2;
}
function* myGeneratorFunction() {
const sum = yield getTwoPlusTwo();
console.log("two plus two equals: ", sum);
}
const g = myGeneratorFunction();
it('Should increment counter when button is pressed', () => {
const button = getByTestId(wrapper, 'increment-counter');
expect(wrapper.state('counter')).toEqual(0);
button.props().onPress();
expect(wrapper.state('counter')).toEqual(1);
});
const getByA11yLabel = (wrapper, value) => wrapper.findWhere((node) =>
node.prop('accessibilityLabel') === value);
const myButton = getByA11yLabel(wrapper, "my-button")