Skip to content

Instantly share code, notes, and snippets.

View rafa-acioly's full-sized avatar
💭
-f

Rafael Acioly rafa-acioly

💭
-f
  • São Paulo - Brazil
View GitHub Profile
{
"products": [
{
"id": 110,
"name": "PINK PANTHER™ T-SHIRT",
"category": "T-SHIRTS",
"regularPrice": 124.99,
"promotions": [
{
"looks": [
@rafa-acioly
rafa-acioly / aula_10.sql
Created April 25, 2018 00:38
functions in sql and plpgsql
create or replace function tipo(varchar)
returns setof notas as
'
SELECT n.* FROM notas n, tiponota t
where t.nome = $1
and t.codigo = n.tipo_nota;
'
language 'sql';
-- select tipo('p1');
@rafa-acioly
rafa-acioly / create_menu_with_submenu_wordpress.php
Created November 18, 2017 15:48
Organize all menus with their respectives submenus.
<?php
function generateMenu ()
{
$array_menu = wp_get_nav_menu_items('main-menu');
$menu = [];
$submenu = [];
foreach ($array_menu as $item_menu) {
if (empty($item_menu->menu_item_parent)) {
$menu[$item_menu->ID] = [
Crie o arquivo dentro de /etc/apache2/sites/available
-> vim mvc.conf // Este comando criara um arquivo com o nome mvc.conf
Dentro deste arquivo coloque o seguinte codigo
<VirtualHost *:80>
ServerName mvc.com.br // Nome da URL que voce quer usar
DocumentRoot /var/www/REST_MVC/public // Aponta a pasta onde estao os arquivos
<Directory /var/www/REST_MVC/public> // Aplica as regras para os arquivos que estao na pasta
DirectoryIndex index.php // Primeira pagina a ser executada
AllowOverride All //