Skip to content

Instantly share code, notes, and snippets.

View CAWeissen's full-sized avatar

Chris Weissenberger CAWeissen

View GitHub Profile
@CAWeissen
CAWeissen / machine.js
Created February 27, 2020 04:06
Generated by XState Viz: https://xstate.js.org/viz
const pedestrianStates = {
initial: 'walk',
states: {
walk: {
after: {
1000: {
target: 'wait',
cond: 'pedestrians'
}
},
@CAWeissen
CAWeissen / machine.js
Created February 18, 2020 03:25
Generated by XState Viz: https://xstate.js.org/viz
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());
@CAWeissen
CAWeissen / machine.js
Created February 17, 2020 18:57
Generated by XState Viz: https://xstate.js.org/viz
const slidesMachine = Machine({
id: 'slides',
initial: 'dashboard',
states: {
dashboard: {
on: {
CREATE: 'create',
EDITING: 'editing'
}
},
const lightMachine = Machine({
id: 'light',
initial: 'green',
states: {
green: {
after: {
1500: 'yellow'
},
on: {
CHANGE: 'yellow'
@CAWeissen
CAWeissen / VideoMachine.js
Last active February 6, 2020 15:32
Generated by XState Viz: https://xstate.js.org/viz
const videoMachine = Machine({
id: 'video',
initial: 'loading',
context: {
video: null,
duration: 0,
elapsed: 0
},
states: {
loading: {
@CAWeissen
CAWeissen / rscsv-p2p-example.csv
Created July 15, 2016 23:19
RSCSV/Posts 2 Posts 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 July 16, 2016 23:14
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)
<?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)) {