Skip to content

Instantly share code, notes, and snippets.

🌮

Josh Pollock Shelob9

🌮
Block or report user

Report or block Shelob9

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View 0.MD

Using WordPress Featured Images In Gatsby

GraphQL Queries For WordPress Posts With Featured Image

query PostsWithFeaturedImage {
  allWordpressPost {
    nodes {
      title
@Shelob9
Shelob9 / 00-windows-development.md
Last active Oct 14, 2019
Set up Windows 10 for web development
View 00-windows-development.md

Git Bash And Git

Go Here Click download. Install git bash.

git config --global user.email "josh@saturdaydrive.io"
git config --global user.name "Josh Pollock"
View Editor.js
export const Editor = ({attributes}) => {
const {something} = attributes;
const [data,setData]= useState({});
useEffect( () => {
fetch( `https://hiroy.club/${something}`)
.then(r => r.json())
.then(r => setData(r);
}, [something, setData]);
return (
<div />
View admin-ajax.php
<?php
add_action('wp_ajax_get_option', function () {
if (empty($_GET['_my_nonce']) || wp_verify_nonce($_GET['_my_nonce'],
'my-nonce-action') || !current_user_can('something')) {
wp_send_json_error();
exit;
}
});
View V.txt
Verifying my Blockstack ID is secured with the address 1C4r2UeoMVxUCoCaeFqdzAFzXmGuuWsYn5 https://explorer.blockstack.org/address/1C4r2UeoMVxUCoCaeFqdzAFzXmGuuWsYn5
View block.json
{
"name": "namespace/name",
"title": "Block Name",
"category": "common",
"icon": "star",
"description": "Shows warning, error or success notices ...",
"keywords": [
"alert",
"message"
View add-on.php
<?php
/**
* Plugin Name: Test Add-on
*/
add_action('wp_enqueue_scripts', function () {
wp_enqueue_script(
'cf-add-on-test',
esc_url_raw(plugins_url('test-add-on.js', __FILE__)),
View redirect-processor.php
<?php
/**
* On form submit, do a redirect to a diffrent site, then complete submission
*/
add_action('caldera_forms_submit_process_start', function (
$form,
$referrer,
$process_id
) {
//If we have a already done redirect, do nothing
View block-submission-based-on-field.js
jQuery(document).ready(function($) {
//variable to prevent blocking all
var blockedOnce = false;
$(document).on("cf.ajax.request", function(e, obj) {
//only block submission once
if (!blockedOnce) {
//Make sure window.cf2 is set properly
if (!window.cf2) {
window.cf2 = {};
}
You can’t perform that action at this time.