Skip to content

Instantly share code, notes, and snippets.

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

calvez calvez

🏠
Working from home
  • Budapest, Hungary
View GitHub Profile
@nexxai
nexxai / .github-actions.yml
Created April 29, 2022 20:48
Laravel - Full Github Action with CodeCov integration and security checker
name: Deployment
on:
push:
branches: [ dev ]
pull_request:
branches: [ master ]
workflow_dispatch:
@Ruzgfpegk
Ruzgfpegk / wp-perf.md
Last active October 12, 2024 16:11
WordPress Performance & Development tips
@calvez
calvez / fix-drupal8-permissions.sh
Created September 23, 2018 19:26 — forked from GreenSkunk/fix-drupal8-permissions.sh
Drupal - Bash shell script to fix Drupal 8 permissions where the PHP Handler is FastCGI.
#!/bin/bash
path=${1%/}
user=${2}
group=${2}
help="\nHelp: This script is used to fix permissions of a Drupal 8 installation in which the PHP Handler is FastCGI\nYou need to provide the following arguments:\n\t 1) Path to your drupal installation\n\t 2) Username of the user that you want to give files/directories ownership\n\nNote: This script assumes that the group is the same as the username if your PHP is compiled to run as FastCGI. If this is different you need to modify it manually by editing this script or checking out forks on GitHub.\nUsage: bash ${0##*/} drupal_path user_name\n"
echo "Refer to https://www.Drupal.org/node/244924"
@jeetsukumaran
jeetsukumaran / bu
Last active August 30, 2022 20:32
Script to drive Restic
#!/usr/bin/env bash
#
# bu: Backup data to repository.
#
# Type 'bu --help' for help on actions and options.
#
# Configuration of 'bu' is done via environmental variables which can be set by user
# in a particular session or saved to a file and read by 'bu'.
#
# Examples of backup configuration files:
@maion11
maion11 / WC_Variable_Product_Price_Range
Created January 18, 2018 05:38
Changing WooCommerce Variable Products Price Range
function wc_varb_price_range( $wcv_price, $product ) {
$prefix = sprintf('%s: ', __('From', 'wcvp_range'));
$wcv_reg_min_price = $product->get_variation_regular_price( 'min', true );
$wcv_min_sale_price = $product->get_variation_sale_price( 'min', true );
$wcv_max_price = $product->get_variation_price( 'max', true );
$wcv_min_price = $product->get_variation_price( 'min', true );
$wcv_price = ( $wcv_min_sale_price == $wcv_reg_min_price ) ?
drush pml --no-core --type=module --status=enabled --pipe | xargs drush -y dis
@calvez
calvez / mysql.sh
Last active April 5, 2017 15:19
Virtualhost script I dunno, but Mysql - # Bash script written by Saad Ismail - [email protected] - thanks guys
#!/bin/bash
# Bash script written by Saad Ismail - [email protected]
# If /root/.my.cnf exists then it won't ask for root password
if [ -f /root/.my.cnf ]; then
echo "Please enter the NAME of the new WordPress/Drupal database! (example: database1)"
read dbname
echo "Please enter the WordPress database CHARACTER SET! (example: utf8_general_ci, utf8, for hungarian wordpress you can use utf8_hungarian_ci...)"
read charset
echo "Creating new WordPress/Drupal database..."
@ChangJoo-Park
ChangJoo-Park / App.js
Last active July 19, 2019 14:52 — forked from niallobrien/App.js
Simple Vue & Vuex fetch example using @feathersjs for realtime data.
// App.js
<template>
<div id="app">
<Messages></Messages>
</div>
</template>
<script>
import Messages from './components/Messages'
import store from './vuex/store'
@tzmartin
tzmartin / m3u8-to-mp4.md
Last active November 17, 2024 04:41
m3u8 stream to mp4 using ffmpeg

1. Copy m3u8 link

Alt text

2. Run command

echo "Enter m3u8 link:";read link;echo "Enter output filename:";read filename;ffmpeg -i "$link" -bsf:a aac_adtstoasc -vcodec copy -c copy -crf 50 $filename.mp4
@calvez
calvez / .htaccess
Last active November 8, 2022 22:57
Hardening Wordpress sites
# Block the include-only files.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^wp-admin/includes/ - [F,L]
RewriteRule !^wp-includes/ - [S=3]
RewriteRule ^wp-includes/[^/]+\.php$ - [F,L]
RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L]
RewriteRule ^wp-includes/theme-compat/ - [F,L]
</IfModule>