This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
echo "Parsing Freemius Webhook"; | |
// Get Freemius data | |
$json = file_get_contents('php://input'); | |
$data = json_decode($json, true); | |
if( isset($data['objects']['user']) ) { | |
// Let's call our opensupports instance | |
$name = $data['objects']['user']['first'] . ' ' . $data['objects']['user']['last']; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# If the branch is not master, execute phpmetrics and upoload everything on the VPS | |
current_branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,') | |
if [ $current_branch != "master" ]; then | |
sshpass -p your-password ssh [email protected] mkdir -p /var/www/your-path/status/master/ | |
sshpass -p your-password rsync --progress -avzP /home/your-user/.cache/QualityAnalyzer/assets -e ssh [email protected]:/var/www/your-metrics/status/$current_branch/ > /dev/null | |
sshpass -p your-password rsync --progress -avzP /home/your-user/.cache/QualityAnalyzer/index.html -e ssh [email protected]:/var/www/your-metrics/status/$current_branch/ > /dev/null | |
/usr/bin/phpmd /var/www/VVV/www/site/public_html/wp-content/plugins/your-plugin/ xml /CodeatCS/codeat-phpmd.xml --exclude vendor,tests --reportfile /tmp/phpmd-analysis.xml | |
/home/your-user/.cache/QualityAnalyzer/bin/analyze analyze /var/www/VVV/www/site/public_html/wp-content/plugins/your-plugin/ --exclude=vendor,tests --exclude_analyzers=cpd,pdepend,checkst |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Get Freemius data | |
$json = file_get_contents('php://input'); | |
$data = json_decode($json, true); | |
if( isset( $data['objects'] ) ) { | |
slack($data); | |
} | |
function slack($data) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
locale=$1 | |
function replace() { | |
sed -i.bak s#https://"$1".wordpress.org/forums/#https://forums.classicpress.net/c/support#g /tmp/"$1"-"$2".po | |
sed -i.bak s/WordPress.org/ClassicPress.net/g /tmp/"$1"-"$2".po | |
sed -i.bak s/WordPress/ClassicPress/g /tmp/"$1"-"$2".po | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
cd /opt/mozita/ | |
cd ./mozitaantispam_bot/ | |
git fetch --all | |
if [[ $(git rev-list HEAD...origin/master --count) -ne 0 ]]; then | |
pkill -f antispam_mozita.py | |
git stash | |
git pull |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mysql --user='[users]' --password='[psw]' --database='[db]' --execute="UPDATE user SET verification_token = NULL WHERE user.verification_token IS NOT NULL;" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('rest_authentication_errors', function ($result) { | |
if (!empty($result)) { | |
return $result; | |
} | |
$access = is_user_logged_in(); | |
if ( !$access ) { | |
if ( !isset($_GET['iwantthem']) || isset($_GET['iwantthem']) && $_GET['iwantthem'] !== 'yes' ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Alert Last Login | |
* Plugin URI: | |
* Description: | |
* Version: 1.0.0 | |
* Author: Codeat | |
* Author URI: http://codeat.it | |
* License: GPL-2.0+ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class VVVScripts < Vagrant.plugin(2, :command) | |
def self.synopsis | |
"Execute script from /config/homebin/" | |
end | |
def execute | |
with_target_vms(nil, single_target: true) do |vm| | |
@env.ui.output "#{$yellow}Executing #{$red}#{ARGV[1]}#{$creset}\n" | |
vm.action(:ssh_run, ssh_run_command: "/srv/config/homebin/#{ARGV[1]}" ) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
function extract() { | |
echo "Estraggo $1.rar" | |
unrar e "./$1.rar" \*.txt \*.wav './clips-mitads/' -o+ | |
} | |
if [ ! -d './clips-mitads' ]; then | |
mkdir './clips-mitads' | |
fi |