Skip to content

Instantly share code, notes, and snippets.

@yankiara
yankiara / oxygen-repeater-dynamic-query.php
Last active September 6, 2023 19:25
Use dynamic queries with Oxygen's repeater
/* I'll put here different examples of dynamic query for Oxygen repeater :
* - Use one of the following repeater_dynamic_query definitions
* in code block just BEFORE the repeater
* - Set the repeater custom query settings : post type, number of posts, order...
* - Add the remove_action in a code block AFTER the repeater
*/
/****************************************************************************************************
* Display related posts for any CPT with taxonomy:
@subhaze
subhaze / index.js
Last active November 29, 2018 15:08
Azure function to update IP on Cloudflare DNS; Usefull for DSM DDNS updates.
// URL set in Synology would look something like this:
// https://<YOUR_SUB_DOMAIN>.azurewebsites.net/api/HttpTriggerJS1?hostname=__HOSTNAME__&ip=__MYIP__&zoneid=__USERNAME__&key=__PASSWORD__&email=<YOUR_CF_EMAIL_LOGIN>&dnsidentifier=<YOUR_DNS_ID_FROM_CF>&recordtype=A
module.exports = function (context, req) {
context.log('JavaScript HTTP trigger function processed a request.');
var http = require('https');
var hostname = req.query.hostname;
var ip = req.query.ip;
var zoneid = req.query.zoneid;
@dborin
dborin / jira_letsencrypt.md
Last active February 3, 2024 10:09
HOWTO Configure Atlassian Jira to use Letsencrypt certificate

HOWTO Configure Atlassian Jira to use Letsencrypt certificate with default Tomcat

This is a primer for installing a Letsencrypt certificate on a Jira server that is running the Jira provided, default Tomcat for serving webpages.

I found lots of information about how to do it using a free-standing Tomcat or nginx, but nothing about this particular combination. I hope it helps you!

Obviously, in all the examples, you need to replace jira.example.com with your own domain! And (duh) you need to use your own password, not 1234

You need to have installed Java (outside the scope of this document). Then in your user's shell RC file and probably root's RC file, add

wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
unxz wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
tar -xvf wkhtmltox-0.12.4_linux-generic-amd64.tar
mv wkhtmltox/bin/* /usr/local/bin/
rm -rf wkhtmltox
rm -f wkhtmltox-0.12.4_linux-generic-amd64.tar
@spivurno
spivurno / gw-gravity-forms-shortcode-attr-field-props.php
Last active October 26, 2021 15:27
Gravity Wiz // Gravity Forms // Custom Field Properties via [gravityforms] Shortcode
<?php
/**
* WARNING! THIS SNIPPET MAY BE OUTDATED.
* The latest version of this snippet can be found in the Gravity Wiz Snippet Library:
* https://github.com/gravitywiz/snippet-library/blob/master/gravity-forms/gw-shortcode-attr-field-props.php
*/
/**
* Gravity Wiz // Gravity Forms // Custom Field Properties via [gravityforms] Shortcode
*
* Provide a custom "field_groups" attribute for the [gravityforms] shortcode. This allows you to modify field
@spivurno
spivurno / gw-gravity-forms-populate-form.php
Last active November 24, 2023 05:14
Gravity Wiz // Gravity Forms // Populate Form with Entry (Optionally Update Entry on Submission)
<?php
/**
* Gravity Wiz // Gravity Forms // Populate Form with Entry (Optionally Update Entry on Submission)
*
* Pass an entry ID and populate the form automatically. No form configuration required. Optionally update the entry on
* submission.
*
* @version 1.5
* @author David Smith <david@gravitywiz.com>
* @license GPL-2.0+
@spivurno
spivurno / gp-copy-cat-gppc_copied_value.html
Created May 12, 2017 01:37
Gravity Perks // GP Copy Cat // Modify Copied Value
<script type="text/javascript">
// me@gravitywiz.com => gravitywiz.com
gform.addFilter( 'gppc_copied_value', function( value, $elem, data ) {
if( data.target == 2 && value ) {
value = value.split( '@' )[1];
}
return value;
} );
@spivurno
spivurno / gw-gravity-forms-validate-current-password.php
Last active October 13, 2021 14:39
Gravity Wiz // Gravity Forms // Validate Current Password
<?php
/**
* Gravity Wiz // Gravity Forms // Validate Current Password
* http://gravitywiz.com/
*/
// update "123" to your form ID, update "6" to your Password field ID
add_filter( 'gform_field_validation_1639_1', function( $result, $value ) {
$user = wp_get_current_user();
if ( ! wp_check_password( $value, $user->data->user_pass, $user->ID ) ) {
$result['is_valid'] = false;
@spivurno
spivurno / gp-preview-submission-display-filename.php
Created March 14, 2017 13:36
Gravity Perks // GP Preview Submission // Display Filename for File Upload Fields
<?php
/**
* Gravity Perks // GP Preview Submission // Display Filename for File Upload Fields
* http://gravitywiz.com/documentation/gravity-forms-preview-submission/
*/
add_filter( 'gpps_special_merge_tags_value_fileupload', function( $value, $field, $input_id, $modifier, $form, $entry ) {
if( ! $field->multipleFiles ) {
$input_name = 'input_' . str_replace( '.', '_', $field->id );
$file_info = GFFormsModel::get_temp_filename( $form['id'], $input_name );
@spivurno
spivurno / gw-gravity-forms-append-admin-label-field-settings.js
Last active July 23, 2017 11:26
Gravity Wiz // Gravity Forms // Append Admin Label to Field Settings Toolbar (via Browser Console)
/**
* Gravity Wiz // Gravity Forms // Append Admin Label to Field Settings Toolbar (via Browser Console)
*
* Provides a simple function for appending the field's admin label to the field settings toolbar.
*
* @version 1.0
* @author David Smith <david@gravitywiz.com>
* @license GPL-2.0+
* @link http://gravitywiz.com/
*