Skip to content

Instantly share code, notes, and snippets.

View JFOC's full-sized avatar
🎯
Focusing

JFOC JFOC

🎯
Focusing
View GitHub Profile
@codeadamca
codeadamca / mamp-php-versions.md
Last active February 11, 2025 19:08
How to add new PHP versions to MAMP on a Mac

Adding Versions of PHP to MAMP on a Mac

If you're working on a project that requires a version of PHP higher than the versions that MAMP comes with, you can easily add additional verions.

My version of MAMP came installed with PHP 7.4.21 and 8.0.8. I'm attempting to use MAMP to host a Laravel application which requires at least PHP 8.1.

The version of PHP MAMP uses is often different than the version you have installed. I have installed PHP using Brew. I'm currently running PHP 8.1.8. If you want to check your installed version of PHP, use the terminal and run the following command:

php --version
@laureen71
laureen71 / nginx.conf RTMP Server
Last active December 10, 2024 02:35
TLS encapsulation RTMP Traffic (RTMPS) with nginx stream module
load_module modules/ngx_rtmp_module.so;
...
rtmp {
server {
listen 0.0.0.0:1935;
# if you want to run all on one server, change port here, eg:
# listen 127.0.0.1:1936;
chunk_size 4000;
notify_method get;
interleave on;
@brut-ctrl
brut-ctrl / README.md
Last active September 12, 2024 15:03
Radio Audio Streaming generate link
@techjewel
techjewel / product_lookup_fluentform.php
Created August 13, 2020 11:10
Get product number and lookup in google sheet and then redirect the user to the target product url.
<?php
/*
* Catch submission the before it's inserting in database
* if you want to log the data in the database use hook: fluenform_before_submission_confirmation
*/
add_action('fluentform_before_insert_submission', function ($insertData, $data, $form) {
if($form->id != 156) { // 156 is our target form id
return;
}
@techjewel
techjewel / fluentform-email-attachment.php
Last active December 31, 2023 15:13
Add Attachment to the email notification programatically in Fluent Forms.
<?php
/*
* Add Attachment to the email notification dynamically.
* @param $attachments array - Array of the attachments.
* @param $notification array - Email Notification array
* @param $form object - The Form Object
* @param $data array - The input submission data
* @return array
*/
@techjewel
techjewel / fluentform-checkbox-max-restriction.js
Last active August 22, 2024 20:46
prevent users to check max 3/x items from a checkbox group - Fluent Forms
/**
* Function to prevent users mark more than expected items.
* This code must need to be placed in custom JS of your form
* @param: containerClass String - The contaner class of the target checkbox block.
* You can add a custom container class in the form settings
*
* @param: maxChecked Integer - Max Number of items user can mark
* @return: void
*
*/
@techjewel
techjewel / fluentform-radio-as-button.css
Created May 25, 2020 23:10
Fluent Forms Radio as Buttons
// You can make the inline radio button look like button switch
// Steps:
// Add container class of the element "ff_button_style"
// Select Layout: Inline Layout
// Lastly add this css to custom css of the form
.ff-el-group.ff_list_inline.ff_button_style .ff-el-form-check {
background: #d2d2d2;
margin: 0 !important;
padding: 0 !important;
@yankiara
yankiara / oxygen-media-breakpoints-buttons.css
Last active January 28, 2021 20:53
Direct access to Oxygen's media breakpoints
.oxygen-media-query-box-wrapper {
position: static;
}
.oxygen-sidebar-currently-editing {
position: relative;
padding-bottom: 48px;
}
.oxygen-media-query-box {
display: none;
}
@techjewel
techjewel / fluentform-submission-success.js
Last active February 23, 2025 12:36
Form submission success JS Event in Fluent Forms
// Event on form submission success
// You can paste this script to Form's custom JS Box
$form.on('fluentform_submission_success', function() {
// You can run your own JS and will be run on successful form submission
});
@ArrayIterator
ArrayIterator / PolygonFixer.php
Created February 19, 2020 08:02
Fix Right Hand Rule Geo JSON clockwise
<?php
declare(strict_types=1);
namespace ArrayIterator;
/**
* Class PolygonFixer
* @package ArrayIterator
* Like a Geo Jeon right-hand-rule Fixer based on {@link https://mapster.me/right-hand-rule-geojson-fixer/}