Skip to content

Instantly share code, notes, and snippets.

View gniuslab's full-sized avatar
😃
Working from home

Abel Rodríguez gniuslab

😃
Working from home
View GitHub Profile
@gniuslab
gniuslab / PHP Version Switcher (Windows).md
Last active May 11, 2024 10:47
PHP Version Switcher (Windows)

Pre-install

  • Remove all keys of php Eviroment Variables of Windows

  • Stop all execution of php programs or console

Installation

  1. Download PHP versions
@gniuslab
gniuslab / Jetbrains IDE's Config.md
Last active September 7, 2022 10:23
Jetbrains IDE's Config

Jetbrains IDE's Config

These are the common settings for my development stack

Before starting If you came from a clean install try to save the file C:\Users\username\AppData\Roaming\JetBrains\PhpStormVersion\c.kdbx

Menu Options

image

@gniuslab
gniuslab / laravel-loop-through-old-flash.php
Created June 3, 2021 07:33 — forked from whoisryosuke/laravel-loop-through-old-flash.php
Laravel - Get old form input values for array-based input
<?php
@if(old('uid_tag'))
@foreach(old('uid_tag') as $product)
<input type="text" name="uid_tag[]" value="{{ old('uid_tag')[$loop->index] }}" size="30" />
<textarea
placeholder="Include weight or count"
name="product_description[]"
cols="45"
rows="1"
value="{{ old('product_description')[$loop->index] }}"
@gniuslab
gniuslab / Nuxt.js .htaccess
Created April 20, 2021 18:16 — forked from mariojankovic/Nuxt.js .htaccess
.htaccess for Nuxt.js under apache
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</IfModule>
@gniuslab
gniuslab / ID.js
Created March 10, 2021 21:52
ID - a unique ID/name generator for JavaScript
// Generate unique IDs for use as pseudo-private/protected names.
// Similar in concept to
// <http://wiki.ecmascript.org/doku.php?id=strawman:names>.
//
// The goals of this function are twofold:
//
// * Provide a way to generate a string guaranteed to be unique when compared
// to other strings generated by this function.
// * Make the string complex enough that it is highly unlikely to be
// accidentally duplicated by hand (this is key if you're using `ID`
@gniuslab
gniuslab / showFile.js
Created February 27, 2021 18:30 — forked from bondgeek/showFile.js
open pdf in pop-up from a blob
/* Use case: returning pdf as blob from XHR request,
for example when the endpoint is secure and needs an Authorization header
NB: responseType on fetch for blobData has to be "blob".
PDF files are not UTF-8, they are binary, so otherwise fonts won't appear properly
*/
const showFile = (blobData, reportName) => {
// Adapted from: https://blog.jayway.com/2017/07/13/open-pdf-downloaded-api-javascript/
const fileName = reportName && `${ reportName }.pdf` || 'myreport.pdf';
@gniuslab
gniuslab / .htaccess
Last active December 22, 2021 20:25 — forked from davemackintosh/.htaccess
Working .htaccess for Single Page Apps and Quasar
<ifModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) /index.html [QSA,L]
</ifModule>