Skip to content

Instantly share code, notes, and snippets.

View lira's full-sized avatar
🐢
Working from home

Fernando Lira lira

🐢
Working from home
View GitHub Profile
@bagerathan
bagerathan / woo-events.js
Last active April 11, 2025 17:46
[Woocommerce Javascript events] #woo
//Woocommerce Checkout JS events
$( document.body ).trigger( 'init_checkout' );
$( document.body ).trigger( 'payment_method_selected' );
$( document.body ).trigger( 'update_checkout' );
$( document.body ).trigger( 'updated_checkout' );
$( document.body ).trigger( 'checkout_error' );
//Woocommerce cart page JS events
$( document.body ).trigger( 'wc_cart_emptied' );
$( document.body ).trigger( 'update_checkout' );
@lovromazgon
lovromazgon / README.md
Last active November 4, 2024 22:27
Schedule starting/stopping a CloudSQL instance on GCP

To use this cloud function follow these steps:

  1. Create a pub/sub topic which will be used to trigger the cloud function.
  2. Create the cloud function and copy in the code below.
    1. Make sure to set the correct project ID in line 8.
    2. Set the trigger to Pub/Sub and choose the topic created in step 1.
  3. Create a cloud scheduler job to trigger the cloud function on a regular basis.
    1. Choose the frequency when you want the cloud function to be triggered.
    2. Set the target to Pub/Sub and define the topic created in step 1.
    3. The payload should be set to start [CloudSQL instance name] or stop [CloudSQL instance name] to start or stop the specified instance (e.g. start my_cloudsql_instance will start the CloudSQL instance with the name my_cloudsql_instance)
@pransteter
pransteter / gist:ecd2cf37f973f93056b01cd66ac70849
Last active June 18, 2020 13:48
Burlar a falta de suporte do docker para resolver hosts no macOS
# Instalar nginx pelo brew:
$ brew install nginx
# Para o nginx:
$ sudo nginx -s stop
# Configurar o arquivo /usr/local/etc/nginx/nginx.conf
@UniqueYang
UniqueYang / inject.css
Last active March 29, 2022 18:10
notion #custom
/*
README
Notion is essentially a web page. We can easily modify elements within the notion by inserting CSS. In the nativefier app, I can again simply put the CSS at `lotion/Lotion/resources/app/inject/inject.css` .
# Feature
- Change the old white bold scroll bar, more modern
- Modify the theme color,basically include the left sidebar, center and code block,Can be changed according to night mode and day mode
@matheusfaustino
matheusfaustino / phpbrew_change_by_dir.sh
Last active April 29, 2020 19:06
Zsh function to change php version per project (directory) using phpbrew
# Add at the end of your .zshrc file
# After every command `cd`, it will check a ".phpbrew" file in the current directory and if it exists it will change the version of php automatically
# Create a .phpbrew file like this: `echo "7.4.4" > .phpbrew` in the folder you want to use the specific version of php
function phpbrew_change_by_dir() {
emulate -L zsh
if [ -f ".phpbrew" ]; then
PHPBREW_LOCAL_VERSION=$(cat .phpbrew);
COMMAND="phpbrew use ";
@Ruzgfpegk
Ruzgfpegk / wp-perf.md
Last active April 9, 2025 09:04
WordPress Performance & Development tips
// time and time end
console.time("This");
let total = 0;
for (let j = 0; j < 10000; j++) {
total += j
}
console.log("Result", total);
console.timeEnd("This");
// Memory
@marcelgsantos
marcelgsantos / palestra-php74.md
Created September 27, 2019 06:36
Referências da palestra 'O que há de novo no PHP 7.4?' apresentada no PHP Community Summit 2019 em São Paulo
@aliesbelik
aliesbelik / benchmarking-tools.md
Last active May 7, 2025 12:33
Benchmarking & load testing tools
@cecilemuller
cecilemuller / 2019-https-localhost.md
Last active April 30, 2025 12:33
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).