Skip to content

Instantly share code, notes, and snippets.

View vaporic's full-sized avatar
🏠
Working from home

Hugo Epinosa vaporic

🏠
Working from home
View GitHub Profile
@vaporic
vaporic / README.md
Created June 26, 2024 20:04 — forked from stolarczyk/README.md
Save GitHub issues as TSV

Save GitHub issues as TSV

This script saves GitHub issues in TSV format

Installation

The script has two software dependancies:

  1. GitHub CLI for querying GitHub API
  2. jq for transforming the output of the above to TSV format
@vaporic
vaporic / .env
Created April 5, 2023 21:21 — forked from KushalRaj/.env
Laravel command for production database replication
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_DATABASE=guesture_stage
DB_USERNAME=dev_user
DB_PASSWORD=****
DB_HOST_2=1.1.1.1#ip of production database server
DB_PORT_2=1234 #port
DB_DATABASE_2=guesture_pro #production database name
DB_USERNAME_2=prod_user #production database username
switch-php() {
valet stop
brew unlink [email protected] [email protected] [email protected]
brew link --force --overwrite php@$1
brew services restart php@$1
composer global update
rm -f ~/.config/valet/valet.sock
valet install
}
@vaporic
vaporic / Laravel-login-username-default-auth.md
Created November 24, 2021 11:52 — forked from amamarul/Laravel-login-username-default-auth.md
Como hacer login en Laravel con username en lugar de por email utilizando la autenticación por defecto

Como hacer login con username en lugar de por email

El controlador App\Http\Controllers\Auth\LoginController implementa el trait AuthenticatesUsers y este es el encargado de realizar la validación del Login. El método validateLogin() valida el campo email por defecto pero este lo obtiene del método username() que retorna el campo email por eso si lo que queremos es validar el login por otro campo (En este ejemplo será el campo 'username') debemos:

1- En la migracion de la tabla users (2014_10_12_000000_create_users_table.php) agregar el campo username es importante que este sea de tipo unique

Schema::create('users', function (Blueprint $table) {
    $table->increments('id');
    $table->string('username')->unique();

$table->string('name');

@vaporic
vaporic / AutoComplete.php
Created November 18, 2021 21:15 — forked from jackabox/AutoComplete.php
Livewire Autocomplete Component
<?php
namespace App\Http\Livewire;
use App\Models\Account;
use Livewire\Component;
class AccountAutocomplete extends Component
{
public $query= '';
@vaporic
vaporic / embedded-file-viewer.md
Created June 5, 2018 21:52 — forked from tzmartin/embedded-file-viewer.md
Embedded File Viewer: Google Drive, OneDrive

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

http://view.officeapps.live.com/op/view.aspx?src=[OFFICE_FILE_URL]

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>
</iframe>

OneDrive Embed Links

@vaporic
vaporic / readme.md
Created November 24, 2017 17:59 — forked from lenivene/readme.md
Get YouTube url ID

Example code

$link = "https://www.youtube.com/watch?v=sOnqjkJTMaA";
$youtube_ID = get_youtube_ID( $link );

echo $youtube_ID;
<?php
/**
* Get Vimeo video id from url
*
* Supported url formats -
*
* https://vimeo.com/11111111
* http://vimeo.com/11111111
@vaporic
vaporic / webpack.config.js
Created October 27, 2016 23:42 — forked from jerolan/webpack.config.js
Sample Basic Webpack Config
var debug = process.env.NODE_ENV !== "production";
var webpack = require('webpack');
module.exports = {
context: __dirname,
devtool: debug ? "inline-sourcemap" : null,
entry: "./js/scripts.js",
output: {
path: __dirname + "/js",
filename: "scripts.min.js"