Skip to content

Instantly share code, notes, and snippets.

Avatar

Chris Weissenberger CAWeissen

View GitHub Profile
View machine.js
const pedestrianStates = {
initial: 'walk',
states: {
walk: {
after: {
1000: {
target: 'wait',
cond: 'pedestrians'
}
},
View machine.js
const apiBase = '/api';
const endpoint = '/presentations';
const getPresentations = () =>
fetch(`${apiBase}${endpoint}`)
.then(response => response.json());
const searchPresentations = (query) =>
fetch(`${apiBase}${endpoint}/?search=${query}`)
.then((response) => response.json());
View machine.js
const slidesMachine = Machine({
id: 'slides',
initial: 'dashboard',
states: {
dashboard: {
on: {
CREATE: 'create',
EDITING: 'editing'
}
},
View TrafficLightMachine.js
const lightMachine = Machine({
id: 'light',
initial: 'green',
states: {
green: {
after: {
1500: 'yellow'
},
on: {
CHANGE: 'yellow'
View VideoMachine.js
const videoMachine = Machine({
id: 'video',
initial: 'loading',
context: {
video: null,
duration: 0,
elapsed: 0
},
states: {
loading: {
@CAWeissen
CAWeissen / rscsv-p2p-example.csv
Created Jul 15, 2016
RSCSV/Posts 2 Posts example CSV
View rscsv-p2p-example.csv
post_id post_date post_author post_status post_type tax_field post_title post_content ministries_prayers missionaries_prayers
Chris publish prayers Bolivia Bolivia Testing connections to between Ministries and Prayers post types, and Missionaries and Prayers post types. slug-1;slug-two slug-one;slug-2
@CAWeissen
CAWeissen / rscsv-p2p-plugin.php
Last active Jul 16, 2016
This plugin allows Posts 2 Posts connections to be created and imported using Really Simple CSV Importer. This WordPress plugin requires Really Simple CSV Importer (https://wordpress.org/plugins/really-simple-csv-importer/) and Posts 2 Posts (https://wordpress.org/support/view/plugin-reviews/posts-to-posts)
View rscsv-p2p-plugin.php
<?php
/*
-------------------------------------------------------
Plugin Name: RSCSV/Posts 2 Posts
Description: Connect imported posts using Posts 2 Posts connections
Author: Chris Weissenberger, Aleksandr Beliaev
Version: 1.3
*/
add_filter('really_simple_csv_importer_post_saved', function($post) {
if (is_object($post)) {
You can’t perform that action at this time.