Skip to content

Instantly share code, notes, and snippets.

@MrDavidChz
MrDavidChz / CSV Seeder.md
Last active March 15, 2018 15:18
Laravel

CSV Seeder

Seed your database with CSV files

This package allows CSV based seeds.

Installation

@MrDavidChz
MrDavidChz / git commands.md
Created December 27, 2017 18:58 — forked from scootcho/git commands.md
git commands #git #commands

initialize git depository in the current directory

git init .

display the git remote/origin

cat .git/config
@MrDavidChz
MrDavidChz / FacturasController.php
Created December 27, 2017 19:29
Laravel Dropzone - with submit button
//add function to Controller
public function uploadFiles(Request $request){
$tipo_factura = $request->input('tipo_factura');
$file = $request->file('files');
$fileName = $file->getClientOriginalName();
$path = "uploads/facturas/";
$expediente_id = $request->input('expediente_id');
if ($file->move($path, $fileName)) {
echo "se movio correctamente el archivo";
@MrDavidChz
MrDavidChz / lic.txt
Last active May 2, 2018 03:05
Sublime Text - Version 3.0 Build 3143
—– BEGIN LICENSE —–
eldon
Single User License
EA7E-1122628
C0360740 20724B8A 30420C09 6D7E046F
3F5D5FBB 17EF95DA 2BA7BB27 CCB14947
27A316BE 8BCF4BC0 252FB8FF FD97DF71
B11A1DA9 F7119CA0 31984BB9 7D71700C
2C728BF8 B952E5F5 B941FF64 6D7979DA
B8EB32F8 8D415F8E F16FE657 A35381CC
@MrDavidChz
MrDavidChz / comandos.md
Last active December 28, 2017 19:05
Comandos Linux

Caracteres Especiales

  • x = Asterisco ->uno o más caracteres
  • ? = Integracion->un caracter
  • [] = Corchetes ->Agrupacion y Rangos
  • " = Comillas Dobles
  • ' = Comillas Simple
  • = Mayor que

  • < = Menor que
@MrDavidChz
MrDavidChz / resourceControllers
Created February 19, 2018 18:07 — forked from d21anthony/resourceControllers
Resource Controllers : Laravel
*****************************************
*HTTP VERB | ACTION *
*****************************************
* GET | READ *
*****************************************
* POST | CREATE *
*****************************************
* PUT | UPDATE *
*****************************************
* DELETE | DELETE *
@MrDavidChz
MrDavidChz / forge.sh
Created June 5, 2019 20:20
Laravel Forge Setup Script
#
# REQUIRES:
# - server (the forge server instance)
# - event (the forge event instance)
# - sudo_password (random password for sudo)
# - db_password (random password for database user)
# - callback (the callback URL)
#
@MrDavidChz
MrDavidChz / parse-jwt.js
Created June 19, 2019 17:54 — forked from Klerith/parse-jwt.js
Parse - JWT - Obtener Payload y fecha de creación y expiración
function parseJwt (token) {
var base64Url = token.split('.')[1];
var base64 = base64Url.replace('-', '+').replace('_', '/');
return JSON.parse(window.atob(base64));
};
# -m = Cree el directorio de inicio del usuario si no existe.
# -G = Nombre del Grupo
# -p = Asignar password
# -s = Asignar Bash "/bin/bash"
useradd -m -G forge newuser -p Password
useradd -m -G forge -s /bin/bash newuser
# agregar contraseña a un usuario
passwd newuser