Skip to content

Instantly share code, notes, and snippets.

Public Form

Build out all required form fields and add recaptacha <script>, passing "key":

form.html

<script src="https://www.google.com/recaptcha/api.js?render={{ recaptcha_key }}"></script>
<div class="g-recaptcha" id="g-recaptcha"
	data-sitekey="{{ recaptcha_key }}"
@WangHansen
WangHansen / userschema.ts
Last active October 14, 2022 18:40
Convert Mongoose js to ts
import { Document, Model, model, Types, Schema, Query } from "mongoose"
import { Company } from "./Company"
// Schema
const UserSchema = Schema<UserDocument, UserModel>({
firstName: {
type: String,
required: true
},
lastName: String,
@jasonbahl
jasonbahl / order-by-acf-like-count.php
Last active July 2, 2024 13:20
Shows how to add a custom order value to a connection to order by a custom field.
add_filter( 'graphql_PostObjectsConnectionOrderbyEnum_values', function( $values ) {
$values['LIKE_COUNT'] = [
'value' => 'like_count',
'description' => __( 'The number of likes on the post', 'wp-graphql' ),
];
return $values;
} );
@mrbar42
mrbar42 / README.md
Last active June 18, 2024 16:43
Secured HLS setup with Nginx as media server

Secured HLS setup with Nginx as media server

This example is part of this article.

This is an example for an HLS delivery with basic security. Nginx compiled with nginx-rtmp-module & secure-link is used as media server. Features:

  • Domain filtering
  • Referrer filtering
  • Embed buster
@ahmadawais
ahmadawais / flywheel-local-xdebug-vscode.md
Last active June 3, 2024 13:28
Debug WordPress with Visual Studio Code | VSCode WordPress Debug Setup | WordPress xDebug Setup for Local by FlyWheel with VSCode | Part of the VSCode Learning Course → https://VSCode.pro

VSCode WordPress Debugging Setup: WordPress Xdebug Setup for Local by FlyWheel with VSCode


Consider supporting my work by purchasing the course this tutorial is a part of i.e. VSCode Power User

🚅 TL;DR

  • Make sure your Local by FlyWheel WordPress install is a custom install
@taniarascia
taniarascia / page.php
Created August 10, 2016 18:09
Displaying all the output from your custom meta box
<?php get_header(); ?>
<?php
$args = array(
'post_type' => 'your_post',
);
$your_loop = new WP_Query( $args ); if ( $your_loop->have_posts() ) : while ( $your_loop->have_posts() ) : $your_loop->the_post();
$meta = get_post_meta( $post->ID, 'your_fields', true ); ?>
@taniarascia
taniarascia / functions.php
Last active February 13, 2024 07:51
Inlcuding custom fields and uploads in a WordPress post
<?php
function create_post_your_post() {
register_post_type( 'your_post',
array(
'labels' => array(
'name' => __( 'Your Post' ),
),
'public' => true,
'hierarchical' => true,
@brennanMKE
brennanMKE / hero.ts
Last active June 28, 2024 07:56
Example of Mongoose with TypeScript and MongoDb
import * as mongoose from 'mongoose';
export let Schema = mongoose.Schema;
export let ObjectId = mongoose.Schema.Types.ObjectId;
export let Mixed = mongoose.Schema.Types.Mixed;
export interface IHeroModel extends mongoose.Document {
name: string;
power: string;
@bmvakili
bmvakili / freemarker_variables_wcm
Created January 20, 2015 14:23
liferay 6.2 GA2 web content template freemarker variables available
scopeGroupId
expandoRowLocalService
reserved-article-id
unicodeLanguageUtil
serviceLocator
reserved-article-author-email-address
userGroupPermission
userPermission
staticFieldGetter
Images
@davidecavaliere
davidecavaliere / portal-developer.properties
Created August 6, 2013 11:33
Liferay's portal-developer.properties to disable embedded firebug-lite console, javascript and html minifier.place this file in /liferay-portal-{version}/tomcat-{tomcat-version}/webapps/ROOT/WEB-INF/classes/
javascript.log.enabled=false
javascript.fast.load=false
theme.css.fast.load=false
com.liferay.portal.servlet.filters.minifier.MinifierFilter=false
com.liferay.filters.strip.StripFilter=false
layout.template.cache.enabled=false
browser.launcher.url=