Skip to content

Instantly share code, notes, and snippets.

View Mainframed69's full-sized avatar
🎯
Focusing

Ronal Lara Mainframed69

🎯
Focusing
View GitHub Profile
@oooh-boi
oooh-boi / gist:80e78f98fb1c0cd48c56a0a414d934b3
Last active May 5, 2023 18:28
Show hide Header on scroll - OoohBoi video tutorial
<script>
"use strict";
OB_ready(OB_doWhenReady);
function OB_doWhenReady() {
// localize everything
var ooohBoi = window.ooohBoi || {};
// local scope variables
ooohBoi.prev_scroll_pos = window.scrollY || document.body.scrollTop;
ooohBoi.cur_scroll_pos;
@Ashanna
Ashanna / functions.php
Last active April 1, 2019 10:22
[Easy Booking] Add a description text before the datepickers (Easy Booking > 2.0)
/**
*
* This function will display a different information text whether there is one or two date(s) to select.
* @param str $text - The information text (empty by default)
* @param WC_Product or WC_Product_Variation - Product or variation object
*
* @return str $text
*
**/
add_filter( 'easy_booking_information_text', 'wceb_custom_info_text', 10, 2 );
@Ashanna
Ashanna / functions.php
Last active April 1, 2019 10:17
[Easy Booking] Change the "Start" and "End" text (Easy Booking > 2.0)
add_filter( 'easy_booking_start_text', 'wceb_custom_start_text', 10, 2 );
function wceb_custom_start_text( $text, $product = false ) {
// You have access to the $product variable (not everywhere) in case you want to display a different text for some products
$text = __( 'Your custom text', 'textdomain' ); // Translation-ready
return $text;
}
@LouWii
LouWii / iptables-config-script
Last active June 29, 2023 13:45
Bash script to configure iptables for a web server. Some rules can be removed depending on used services.
#!/bin/sh
# Empty all rules
sudo iptables -t filter -F
sudo iptables -t filter -X
# Bloc everything by default
sudo iptables -t filter -P INPUT DROP
sudo iptables -t filter -P FORWARD DROP
sudo iptables -t filter -P OUTPUT DROP