Skip to content

Instantly share code, notes, and snippets.

View meksone's full-sized avatar
🏠
Working from home

meksONE meksone

🏠
Working from home
View GitHub Profile
@Lonsdale201
Lonsdale201 / code
Created December 7, 2024 00:33
JetFormBuilder - Call webhook - Call Chatgpt
// place the code in the child theme functions.php or a custom code snippets plugin like Fluent Snippts etc..
// You need to add two key in your wp-config.php
// first open your wp-config.php and define( 'OPENAI_API_KEY', 'My_Chatgpt_API');
// add a new line with your auth token: define( 'CUSTOM_API_TOKEN', 'My_auth_token');
// example token define( 'CUSTOM_API_TOKEN', 'a3f9c74d2b69a7e1bcd15e2e4fc98a6c4ed12e9985bcae439f6ad5db95f17c23');
// in the Custom api token you can enter anything
// open your functions.php or fluentsnippets and paste the code which you can find below
// open your jetformbuilder add a new webhook submission and paste your wesbite domain name like
// https://mywebsite.com/wp-json/custom-webhooks/v1/chatgpt-handler?api_token=CUSTOM_API_TOKEN
@JuliaKiselyova
JuliaKiselyova / scroll_after_ajax.js
Last active May 9, 2025 07:51
Jet Smart Filter scroll to query ID element after click on filter
document.addEventListener('jet-smart-filters/inited', function(initEvent) {
jQuery(function($) {
window.JetSmartFilters.events.subscribe('ajaxFilters/updated', function(provider, queryId) {
const elementToScrollToId = 'all_ads_listing'; // Specify the ID of the element you want to scroll to
const elementToScrollTo = document.getElementById(elementToScrollToId);
if (elementToScrollTo) {
elementToScrollTo.scrollIntoView({
behavior: 'smooth',
block: 'start',
@t27
t27 / linux-oom-killer-fixes.md
Last active June 2, 2025 10:26
Dealing with the Linux OOM Killer

Dealing with the Linux OOM Killer at the program level

Do this in cases when you dont want to change the os-level settings, but only want to disable the OOM killer for a single process. This is useful when youre on a shared machine/server.

The OOM killer uses the process level metric called oom_score_adj to decide if/when to kill a process. This file is present in /proc/$pid/oom_score_adj. The oom_score_adj can vary from -1000 to 1000, by default it is 0.

You can add a large negative score to this file to reduce the probability of your process getting picked and terminated by OOM killer. When you set it to -1000, it can use 100% memory and still avoid getting terminated by OOM killer.