Skip to content

Instantly share code, notes, and snippets.

View gnovaro's full-sized avatar
:octocat:
Adding lines to the open source

Gustavo Novaro gnovaro

:octocat:
Adding lines to the open source
View GitHub Profile
@gnovaro
gnovaro / config
Created February 1, 2023 19:32
SSH Config github configuration ~/.ssh/config
Host github.com
User git
Hostname github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/github-asus
@gnovaro
gnovaro / OpenSourceCRM.rst
Last active May 24, 2022 14:29 — forked from cstroe/OpenSourceCRM.rst
A distilled list of open-source CRM software
@gnovaro
gnovaro / .vimrc
Created January 17, 2022 00:55
My default VIM configuration file .vimrc add in your home dir /home/username
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"
" ██╗ ██╗██╗███╗ ███╗██████╗ ██████╗
" ██║ ██║██║████╗ ████║██╔══██╗██╔════╝
" ██║ ██║██║██╔████╔██║██████╔╝██║
" ╚██╗ ██╔╝██║██║╚██╔╝██║██╔══██╗██║
" ╚████╔╝ ██║██║ ╚═╝ ██║██║ ██║╚██████╗
" ╚═══╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
@gnovaro
gnovaro / .bash_profile
Last active January 13, 2022 20:08
Bash profile for automatic loading ssh keys on login. Add this file in you home directory
if [ -z "$SSH_AUTH_SOCK" ] ; then
eval `ssh-agent -s`
ssh-add
fi
@gnovaro
gnovaro / psql_useful_stat_queries.sql
Last active April 7, 2021 09:21 — forked from anvk/psql_useful_stat_queries.sql
List of some useful Stat Queries for PSQL
--- PSQL queries which also duplicated from https://github.com/anvk/AwesomePSQLList/blob/master/README.md
--- some of them taken from https://www.slideshare.net/alexeylesovsky/deep-dive-into-postgresql-statistics-54594192
-- I'm not an expert in PSQL. Just a developer who is trying to accumulate useful stat queries which could potentially explain problems in your Postgres DB.
------------
-- Basics --
------------
-- Get indexes of tables
@gnovaro
gnovaro / console.php
Created March 22, 2021 09:34 — forked from meigwilym/console.php
Laravel Create User Command
<?php
// routes/console.php
// quickly create an user via the command line
Artisan::command('user:create', function () {
$name = $this->ask('Name?');
$email = $this->ask('Email?');
$pwd = $this->ask('Password?');
// $pwd = $this->secret('Password?'); // or use secret() to hide the password being inputted
\DB::table('users')->insert([
@gnovaro
gnovaro / log.php
Last active May 16, 2024 11:16
Tail log php
<?php
/**
* Error Log Tail
* @author Gustavo Novaro
* @version 1.0.3
* Set in php.ini error_log=
*/
// Linux Path
$log_path = '/var/log/php_error.log';
// Windows path
@gnovaro
gnovaro / lamp_setup.sh
Last active July 19, 2019 14:33
PHP Lamp Setup Nginx + PHP 7.3
#!/bin/bash
# One Click LAMP Server Installer (Ubuntu/Debian) - Roskus
# @author Gustavo Novaro
# @version 3.3.1
# @url https://gist.github.com/gnovaro/5295150774be1794028c15c83313c16e
# Run: sudo ./lamp_setup.sh
###############################################
#Servidor Web http
apt-get install -y nginx
@gnovaro
gnovaro / formatCreditCard.js
Last active May 27, 2022 11:31
Format credit card
function formatCrediCard(cardtype, number)
{
let format;
if(cardtype == 'amex')
{
//XXXX XXXXXX XXXXX
format = number.substr(0,4)+" "+number.substr(4,6)+" "+number.substr(10,5);
} else {
//XXXX XXXX XXXX XXXX
format = number.substr(0,4)+" "+number.substr(4,4)+" "+number.substr(8,4)+" "+number.substr(12,4);
@gnovaro
gnovaro / PageController.php
Last active April 18, 2017 14:36 — forked from marktopper/PageController.php
[Voyager] Routes for Pages BREAD
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class PageController extends \App\Http\Controllers\Controller
{
public function show()
{
$slug = request()->segment(1);