Skip to content

Instantly share code, notes, and snippets.

View ribafs's full-sized avatar
❤️
Estudando e Trabalhando

Ribamar FS ribafs

❤️
Estudando e Trabalhando
View GitHub Profile
@ribafs
ribafs / gist:68d760e745d6c71521c0cf93be1499a2
Last active December 29, 2023 13:41
Receive param value from xml in php component joomla 4
My XML
<?xml version="1.0" encoding="UTF-8"?>
<extension type="component" version="3.0" method="upgrade">
<name>testepar</name>
<creationDate>Outubro 2023</creationDate>
<author>Ribamar FS</author>
<authorEmail>ribafs@gmail.com</authorEmail>
<authorUrl>https://ribamar.net.br</authorUrl>
<copyright>Copyright (C) 2016 Ribamar FS. All rights reserved.</copyright>
@ribafs
ribafs / gist:639fe62709fff4ade27b8ad37b2510bd
Created October 2, 2023 23:55
Instalação do laravel
# Instalação do laravel
composer create-project laravel/laravel example-app
composer create-project laravel/laravel --prefer-dist example-app (usa o cache para deixar a instalação mais rapida)
## Instalar da versão 9 do laravel
composer create-project laravel/laravel laravel9 9.5.2
@ribafs
ribafs / Popular combo de outra tabela
Last active August 28, 2023 12:09
Popular combo com registros de outra tabela
@ribafs
ribafs / singularize.php
Last active June 1, 2023 22:50 — forked from peter-mcconnell/singularize.php
PHP singularize
<?php
/**
* Singularize a string.
* Converts a word to english singular form.
*
* Usage example:
* {singularize "people"} # person
*/
function singularize ($params)
{
@ribafs
ribafs / app.js
Created November 21, 2022 17:20 — forked from prof3ssorSt3v3/app.js
IndexedDB part 4 - add, put, and delete
import { uid } from './uid.js';
console.log(uid());
//nothing else to import because we are using the built in methods
//https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase
const IDB = (function init() {
let db = null;
let objectStore = null;
let DBOpenReq = indexedDB.open('WhiskeyDB', 6);
@ribafs
ribafs / README.md
Created November 15, 2022 17:05 — forked from joyrexus/README.md
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@ribafs
ribafs / markdown-details-collapsible.md
Created November 12, 2022 16:16 — forked from pierrejoubert73/markdown-details-collapsible.md
How to add a collapsible section in markdown.

How to

<details>
  <summary>Click me</summary>
  
  ### Heading
  1. Foo
  2. Bar
     * Baz
 * Qux
@ribafs
ribafs / ErrorReporting.php
Created September 26, 2022 11:33 — forked from mevdschee/ErrorReporting.php
PHP error reporting class
<?php
class ErrorReporting
{
public static $errorMessage = 'Oops! Something went wrong.';
private static $cwd;
private static $debug;
/**
@ribafs
ribafs / Dumper.php
Created September 26, 2022 11:26 — forked from nicolas-grekas/Dumper.php
Advanced error handling in PHP
<?php /****************** vi: set fenc=utf-8 ts=4 sw=4 et: *****************
*
* Copyright : (C) 2011 Nicolas Grekas. All rights reserved.
* Email : p@tchwork.org
* License : http://www.gnu.org/licenses/lgpl.txt GNU/LGPL
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
Brincando com arrays múltiplos
Quer ver algo que me enrolava todo? Arrays múltiplos.
Como faço paga pegar alguns dos seus elementos?
Exemplo para diversão e aprendizado:
Array ( [0] => 1 [1] => Array ( [0] => App\Controllers\ProductController Object ( ) [1] => edit ) [2] => Array ( [table] => product [action] => edit [id] => 3 ) )