Skip to content

Instantly share code, notes, and snippets.

View jamesrmoro's full-sized avatar
🎯
Focusing

James R. Moro jamesrmoro

🎯
Focusing
View GitHub Profile
@jamesrmoro
jamesrmoro / config.desenvolvimento.txt
Last active August 24, 2016 04:25
Preparação para ambiente de trabalho em Linux
http://webmasters.stackexchange.com/questions/61009/how-to-enable-use-of-htaccess-in-apache-on-ubuntu
Instala uma nova opção de terminal
sudo apt install yakuake
yakuake&
-------------------------------------------------------------------------
FileZilla não salva senha dos servidores web.
Para resolver o problema, desmarcar a caixa: “Não salvar senhas”, que está no menu “Editar >> Configurações >> Interface”
@jamesrmoro
jamesrmoro / tabuada.php
Created November 25, 2015 14:29
Tabuada com array
<?php
$numeros = array('1', '2', '3', '4', '5', '6', '7', '8', '9', '10');
echo "<table>";
echo "<tr>";
foreach ($numeros as $x) {
foreach ($numeros as $y) {
echo "<td>" . ($x * $y) . "</td>";
}
echo "</tr>";
@jamesrmoro
jamesrmoro / configuracao-pc.txt
Last active February 2, 2017 12:07
Configuração de ambiente de desenvolvimento
1. Download | Ubuntu 14.04 LTS
-----------------------------------------
2. Formatar pendrive | http://www.baixaki.com.br/download/usb-disk-storage-format-tool.htm
-----------------------------------------
3. Pendrive ISO | http://www.pendrivelinux.com/universal-usb-installer-easy-as-1-2-3/#button
-----------------------------------------
4. Instalar Yakuake
sudo apt install yakuake
- o comando yakuake& inicia
@jamesrmoro
jamesrmoro / web.config
Created August 12, 2016 18:11
Permalinks WP
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="WordPress: http://colmeiasites.com.br" patternSyntax="Wildcard">
<match url="*"/>
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>
1. install openjdk
`sudo apt-get install openjdk-7-jdk`
2. install `android sdk`
# download android sdk
wget http://dl.google.com/android/android-sdk_r24.2-linux.tgz
tar -xvf android-sdk_r24.2-linux.tgz
cd android-sdk-linux/tools
@jamesrmoro
jamesrmoro / link-adminize.txt
Last active January 8, 2018 12:01
Link Adminize
@jamesrmoro
jamesrmoro / searchreplacedb2.php
Last active May 8, 2019 20:28
Search Replace DB 2
<?php
/**
*
* Safe Search and Replace on Database with Serialized Data v2.0.1
*
* This script is to solve the problem of doing database search and replace when
* developers have only gone and used the non-relational concept of serializing
* PHP arrays into single database columns. It will search for all matching
* data on the database and change it, even if it's within a serialized PHP
* array.
@jamesrmoro
jamesrmoro / convert-nextgen-galleries.php
Created January 8, 2018 12:06
Convert NextGEN Galleries to WordPress
<?php
/*
Plugin Name: Convert NextGEN Galleries to WordPress
Plugin URI:
Description: Converts NextGEN galleries to WordPress default galleries.
Version: 1.0
Author: Stefan Senk
Author URI: http://www.senktec.com
License: GPL2
@jamesrmoro
jamesrmoro / get-terms-wordpress.php
Last active January 19, 2018 13:37
Get Terms Wordpress
<?php
$terms = get_terms( 'categoria-produto' );
echo '<ul>';
foreach ( $terms as $term ) {
$term_link = get_term_link( $term );
@jamesrmoro
jamesrmoro / produtos-relacionados.php
Created January 19, 2018 13:36
Produtos relacionados com Custom Post, Taxonomia e Terms
<?php
$terms = get_the_terms( get_the_ID(), 'categoria-produto' );
if ( $terms && ! is_wp_error( $terms ) ) :
foreach ( $terms as $term ) {
$term_name = $term->name;
}
endif;
$term = get_term_by( 'name', $term_name,'categoria-produto');