Skip to content

Instantly share code, notes, and snippets.

View igorsgm's full-sized avatar
👨‍💻
Staying hungry, staying foolish.

Igor Moraes igorsgm

👨‍💻
Staying hungry, staying foolish.
View GitHub Profile
diff --git a/homestead.rb b/homestead.rb
index 8d77a34..3fff00d 100644
--- a/homestead.rb
+++ b/homestead.rb
@@ -19,7 +19,8 @@ class Homestead
config.vm.hostname = settings["hostname"] ||= "homestead"
# Configure A Private Network IP
- config.vm.network :private_network, ip: settings["ip"] ||= "192.168.10.10"
+ # config.vm.network :private_network, ip: settings["ip"] ||= "192.168.10.10"

Don't forget to set PHP Code Style to PSR-2 in your PHPStorm


1) Add Code Sniffer to composer.json file

composer require squizlabs/php_codesniffer
@igorsgm
igorsgm / iterm2-solarized.md
Last active January 16, 2020 21:15 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@igorsgm
igorsgm / Criar novo Usuário e Schema.sql
Created August 13, 2018 16:53
#Criar novo Usuário e Schema no Banco de Dados Oracle
CREATE USER NOME_USUARIO_AQUI IDENTIFIED BY SENHA_USUARIO_AQUI DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE TEMP ACCOUNT UNLOCK;
GRANT CREATE SESSION TO NOME_USUARIO_AQUI;
GRANT CREATE TABLE TO NOME_USUARIO_AQUI;
ALTER USER NOME_USUARIO_AQUI QUOTA UNLIMITED ON USERS;
GRANT EXP_FULL_DATABASE TO NOME_USUARIO_AQUI;
GRANT CONNECT TO NOME_USUARIO_AQUI;
GRANT create session, alter session TO NOME_USUARIO_AQUI;
GRANT create procedure to NOME_USUARIO_AQUI;
GRANT execute any procedure to NOME_USUARIO_AQUI;
GRANT create table TO NOME_USUARIO_AQUI;
<?php
JHtml::_('script', 'media/jui/js/article-img-credits.js', false, false, false, false, true);
@igorsgm
igorsgm / User.php
Created February 22, 2017 22:48
Coletar informações de um User
<?php
// Importar se for utilizar o JUserHelper
jimport( 'joomla.user.helper' );
$userId = JUserHelper::getUserId('username');
$user = JFactory::getUser($userId);
<?php
JLoader::register('ComponentClassNameHelper', JPATH_COMPONENT);
<?php
$user = JFactory::getUser();
$isroot = $user->authorise('core.admin');
js = jQuery.noConflict();
js(document).on('click', '.close', function () {
// Pausar e resetar video do YouTube
js(".modal iframe").attr("src", js(".modal iframe").attr("src"));
js('audio').each(function () {
this.pause(); // Pausar áudio
this.currentTime = 0; // Resetar tempo
});
@igorsgm
igorsgm / Filtro parseUrl.js
Last active December 28, 2016 19:56
Filtro para transformar urls em links clicáveis @READ https://devdactic.com/angularjs-filters-html-parsing/
.filter('parseUrl', function ($sce) {
var urls = /(\b(https?|ftp):\/\/[A-Z0-9+&@#\/%?=~_|!:,.;-]*[-A-Z0-9+&@#\/%=~_|])/gim;
var emails = /(\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,6})/gim;
return function (text) {
if (text.match(urls)) {
text = text.replace(urls, '<a href="$1">$1</a>');
}
if (text.match(emails)) {
text = text.replace(emails, '<a href=\"mailto:$1\">$1</a>');