Skip to content

Instantly share code, notes, and snippets.

Avatar
🕶️
Working on Code

Lucas lucasprogamer

🕶️
Working on Code
View GitHub Profile
View ui.datepicker-pt-BR.js
/* Brazilian initialisation for the jQuery UI date picker plugin. */
/* Written by Leonildo Costa Silva (leocsilva@gmail.com). */
jQuery(function($){
$.datepicker.regional['pt-BR'] = {
closeText: 'Fechar',
prevText: '<Anterior',
nextText: 'Próximo>',
currentText: 'Hoje',
monthNames: ['Janeiro','Fevereiro','Março','Abril','Maio','Junho',
'Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'],
@lucasprogamer
lucasprogamer / Vagrantfile
Created Jul 30, 2017
Setting vagrant-hostmanager
View Vagrantfile
if Vagrant.has_plugin? 'vagrant-hostmanager'
config.hostmanager.enabled = true
config.hostmanager.manage_host = true
config.hostmanager.manage_guest = true
config.vm.provision :hostmanager
settings = YAML::load(File.read(homesteadYamlPath))
config.hostmanager.aliases = settings['sites'].map { |item| item['map'] }
puts "hostmanager aliases: " + config.hostmanager.aliases.join(' ')
@lucasprogamer
lucasprogamer / WP .htacess cache controll
Last active Oct 30, 2017
Add after # END WordPress.
View WP .htacess cache controll
#Força a utilizar Cache-Control e Expires header
<IfModule mod_headers.c>
Header unset ETag
</IfModule>
FileETag None
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 1 month"
ExpiresByType text/cache-manifest "access plus 0 seconds"
# Html
View load-more-posts.php
#Usage
add in functions
function load_more_button($context = 'default', $text = 'Carregar Mais', $template = 'parts/cards', $paged = 0)
{
if (empty($paged)) {
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
}
$load_more = new Load_More_Posts();
$load_more->load_more_button($context, $text, $template, $paged);
View gist:98807579895563fe5a114ebc1340795d
<?php
function devplus_attachments_wpquery_where( $where ){
if( is_user_logged_in() ){
// we spreken over een ingelogde user
if( isset( $_POST['action'] ) ){
// library query
if( $_POST['action'] == 'query-attachments' ){
$where .= ' AND post_parent != 0';
}
@lucasprogamer
lucasprogamer / main.js
Created May 21, 2018
CF7 Bulma Ajax-loader icon
View main.js
/**
* when cf7 ajax-loader
* @param {[type]} form [description]
* @return {[type]} [description]
*/
wpcf7.submit = function( form ) {
if ( typeof window.FormData !== 'function' ) {
return;
}
View set-robot-git-ftp.md

.git-ftp-ignore | Conteúdo abaixo

bower_components/* node_modules/*

.git-ftp-include | Conteúdo abaixo

vendor/:composer.lock

Dentro da pasta .git, checar arquivo config

@lucasprogamer
lucasprogamer / php.mdown
Created Jun 25, 2018
malformed header from script. Bad header=&lt;br /&gt;: index.php
View php.mdown

this error happens because exists tags from olds version of PHP

check if exists in php.ini and remove or comment allow_call_time_pass_reference

check if exist any tag unable in php 7.1 like

;asp_tags = Off ;register_globals = Off

@lucasprogamer
lucasprogamer / functions.php
Created Jun 29, 2018
Add collumn to metabox of invoices woocomerce
View functions.php
add_action( 'woocommerce_admin_order_item_headers', 'collumn_invoice_header' );
function collumn_invoice_header($order){
?>
<th class="line_produtor_title sortable" data-sort="your-sort-option">
name collumn
</th>
<?php
}