Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

PAULO RICARDO RUBE DE ALMEIDA rickslayer

🏠
Working from home
View GitHub Profile
@rickslayer
rickslayer / remover_menu_admin_wordpress.php
Created Dec 23, 2020
Removendo menu admin do wordpress
View remover_menu_admin_wordpress.php
<?php
function remove_menus()
{
// REMOVE O MENU Comentários
remove_menu_page('edit-comments.php');
}
add_action('admin_init', 'remove_menus');
@rickslayer
rickslayer / bloquear_permitir_comentarios_por_padrao_wordpress.php
Created Dec 21, 2020
Bloquear permitir comentários por padrão no wordpress
View bloquear_permitir_comentarios_por_padrao_wordpress.php
<?php
function remove_allow_comments_default($data)
{
$data['comment_status'] = 0;
return $data;
}
add_action( 'wp_insert_post_data', 'remove_allow_comments_default', 10, 3 );
@rickslayer
rickslayer / wordpress_mudar_tela_de_login.php
Last active Dec 16, 2020
Como mudar a tela de login do Wordpress
View wordpress_mudar_tela_de_login.php
<?php
//Arquivo functions.php
function muda_cor_botao(){?>
<style type="text/css">
/*PARA MUDAR O FUNDO DA PÁGINA*/
body{
background:#black !important;
}
@rickslayer
rickslayer / deploy.php
Created Sep 14, 2020 — forked from oxguy3/deploy.php
Script used to automatically deploy from GitHub to a cPanel shared hosting server
View deploy.php
<?php
/**
* deploy.php by Hayden Schiff (oxguy3)
* Available at https://gist.github.com/oxguy3/70ea582d951d4b0f78edec282a2bebf9
*
* No rights reserved. Dedicated to public domain via CC0 1.0 Universal.
* See https://creativecommons.org/publicdomain/zero/1.0/ for terms.
*/
// random string of characters; must match the "Secret" defined in your GitHub webhook
View descer-ate-div-apertando-tecla.js
$(window).on('keydown', function (e) {
if (e.which != 40) return false;
var posicao = $('#destino').position().top;
$('html, body').stop().animate({
scrollTop: posicao
}, 1500);
});
View verificaCamposPreenchidos.js
$(function(){
let el = $("#elementoPai").find('input, select');
let cnt = el.filter(function(){
return !$(this).val();
}).length;
if (cnt == el.length){
alert('erro');
}else {
alert('tudoOK');
});
View fillSelectedWithJSON
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script scr="https://code.jquery.com/jquery-3.2.1.min.js"></script>
View eloquent_tips_laravel.php
--Simple Where
Model::where('field', '*operator', 'value').
//*operator = "< , >, =, =>, =< etc"
-- Between where
Model::whereBetween('field',['value1', 'value2']);
-- Raw Where for exclusive treatments
Model::whereRaw('LEFT(field, 4) = tesssttteeee')
@rickslayer
rickslayer / rck_send_param_and_files.html
Created Apr 5, 2019
Send parameteres and Files together Ajax - Enviar parametros e arquivos juntos em requisição
View rck_send_param_and_files.html
<html>
<input type="file" id="files">
</html>
<script>
$(function(){
$("#files").on('change', function(event)
{
form = new FormData();
form.append('files', event.target.files[0]);
form.append('anotherparam', "teste");
@rickslayer
rickslayer / rck_Ship_to_a_different_address_wc.php
Created Mar 2, 2019
Retirar o checkbox marcado como padrão endereço de cobrança no Checkout Woocommerce
View rck_Ship_to_a_different_address_wc.php
<?php
add_filter( 'woocommerce_ship_to_different_address_checked', '__return_true' );
?>