Skip to content

Instantly share code, notes, and snippets.

View venturion's full-sized avatar

Felipe Venturino venturion

View GitHub Profile
@bagerathan
bagerathan / woo-events.js
Last active April 26, 2024 18:43
[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' );
@GlauberF
GlauberF / KeyEventSimulator.js
Created April 29, 2020 10:28
A function for simulating key event in JavaScript. You just have to choose what key and keyboard event you want to simulate.
/**
* Simulate a key event.
* @param {Number} keyCode The keyCode of the key to simulate
* @param {String} type (optional) The type of event : down, up or press. The default is down
* @param {Object} modifiers (optional) An object which contains modifiers keys { ctrlKey: true, altKey: false, ...}
*/
function simulateKey (keyCode, type, modifiers) {
var evtName = (typeof(type) === "string") ? "key" + type : "keydown";
var modifier = (typeof(modifiers) === "object") ? modifier : {};
@andreconghau
andreconghau / ig_convert_media_id_to_url
Created September 18, 2019 06:06
Instagram Convert Media ID to Post URl
// based on ggwarpig stackoverflow anwser to
// "Where do I find the Instagram media ID of a image"
// @ https://stackoverflow.com/a/37246231
function instagram_id_to_url($instagram_id){
$url_prefix = "https://www.instagram.com/p/";
if(!empty(strpos($instagram_id, '_'))){
@autorunman22
autorunman22 / webpack.mix.js
Last active March 25, 2022 02:49
Laravel common mix setup for vue.js + pug.js
const mix = require('laravel-mix');
mix.webpackConfig({
module: {
rules: [
{
test: /\.pug$/,
loader: 'pug-plain-loader'
}
]
#cron jobs
php /caminho/para/seu-site/bin/magento cron:run 2>&1 | grep -v "Ran jobs by schedule" >> /caminho/para/seu-site/var/log/magento.cron.log
php /caminho/para/seu-site/update/cron.php >> /caminho/para/seu-site/var/log/update.cron.log
php /caminho/para/seu-site/bin/magento setup:cron:run >> /caminho/para/seu-site/var/log/setup.cron.log
@AhmadMunir
AhmadMunir / confirm-password-with-html5.markdown
Created December 26, 2018 00:16
Confirm password with HTML5
//plugins/axios.js
export default function ({ $axios, app }) {
$axios.onError(error => {
const code = parseInt(error.response && error.response.status)
if ([401, 403].includes(code)) {
app.$auth.logout();
}
@mpalencia
mpalencia / httpd-xampp5.6.conf
Last active June 25, 2021 04:14
Additional setting for XAMPP running PHP 7.2 with PHP 5.6
#
# XAMPP settings
#
<IfModule env_module>
SetEnv MIBDIRS "C:/xampp/php5.6/extras/mibs"
SetEnv MYSQL_HOME "\\xampp\\mysql\\bin"
SetEnv OPENSSL_CONF "C:/xampp/apache/bin/openssl.cnf"
SetEnv PHP_PEAR_SYSCONF_DIR "\\xampp\\php5.6"
SetEnv PHPRC "\\xampp\\php5.6"
@cyberwani
cyberwani / .htaccess
Created August 10, 2018 09:39
Block the HTTRACK using HTACCESS files
Options All -Indexes
# Ultimate htaccess Blacklist 2 from Perishable Press
# Deny domain access to spammers and other scumbags
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_USER_AGENT} ADSARobot|ah-ha|almaden|aktuelles|Anarchie|amzn_assoc|ASPSeek|ASSORT|ATHENS|Atomz|attach|attache|autoemailspider|BackWeb|Bandit|BatchFTP|bdfetch|big.brother|BlackWidow|bmclient|Boston\ Project|BravoBrian\ SpiderEngine\ MarcoPolo|Bot\ mailto:craftbot@yahoo.com|Buddy|Bullseye|bumblebee|capture|CherryPicker|ChinaClaw|CICC|clipping|Collector|Copier|Crescent|Crescent\ Internet\ ToolPak|Custo|cyberalert|DA$|Deweb|diagem|Digger|Digimarc|DIIbot|DISCo|DISCo\ Pump|DISCoFinder|Download\ Demon|Download\ Wonder|Downloader|Drip|DSurf15a|DTS.Agent|EasyDL|eCatch|ecollector|efp@gmx\.net|Email\ Extractor|EirGrabber|email|EmailCollector|EmailSiphon|EmailWolf|Express\ WebPictures|ExtractorPro|EyeNetIE|FavOrg|fastlwspider|Favorites\ Sweeper|Fetch|FEZhead|FileHound|FlashGet\ WebWasher|FlickBot|fluffy|FrontPage|GalaxyBot|Generic|Getleft|GetRight|
@jaskiratr
jaskiratr / chmod-400.cmd
Created June 29, 2018 01:03
Set permission of file equivalent to chmod 400 on Windows.
# Source: https://stackoverflow.com/a/43317244
$path = ".\aws-ec2-key.pem"
# Reset to remove explict permissions
icacls.exe $path /reset
# Give current user explicit read-permission
icacls.exe $path /GRANT:R "$($env:USERNAME):(R)"
# Disable inheritance and remove inherited permissions
icacls.exe $path /inheritance:r