Skip to content

Instantly share code, notes, and snippets.

Controller with all resources:
php artisan make:controller {ControllerName} --resource
Controller / Model / Migration
php artisan make:model {ModelName} -crm
Seed
php artisan make:seeder {ModelName}Seeder
Run Seed:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="" content="">
<title>Tabulator Template</title>
@nosajhpled
nosajhpled / Create Laravel Project.txt
Last active November 21, 2021 14:52
Create Laravel Project
composer create-project --prefer-dist laravel/laravel <Project Name>
composer require livewire/livewire && npm install && npm install -D tailwindcss@latest postcss@latest autoprefixer@latest && npx tailwindcss init
tailwind.config.js:
purge: [
'./resources/**/*.blade.php',
'./resources/**/*.js',
'./resources/**/*.vue',
],
@nosajhpled
nosajhpled / default.html
Last active January 9, 2019 15:15
Default HTML Code Template
<!DOCTYPE html>
<html lang="en">
<head>
<title></title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="" content="">
<!-- CSS -->
@nosajhpled
nosajhpled / Convert FoxPro to Microsoft SQL Server
Created August 31, 2018 20:29
Convert FoxPro to Microsoft SQL Server
The easiest way to convert FoxPro to Microsoft SQL Server is to copy the FoxPro file to a CSV and use the SQL Server Import and Export Wizard.
In FoxPro
use NameOfFile (or ?)
copy to NameOfFile type csv
This will give you a clean CSV with a header line.
@nosajhpled
nosajhpled / Getting CPU information from the command line [Windows]
Created August 31, 2018 20:29
Getting CPU information from the command line [Windows]
Here is an easy way to get CPU information from the command line:
wmic cpu get /format:list
Below is examples of some of the information provided from the command:
Description
L2 Cache
L3 Cache
Max Clock Speed
@nosajhpled
nosajhpled / Two ways to fake a SQL table [SQL]
Created August 31, 2018 20:27
Two ways to fake a SQL table [SQL]
The first way is to create a temporary table and insert values into it.
DECLARE @declareTable TABLE (seq int, name VARCHAR(5) ) ;
INSERT INTO @declareTable (seq,name) values
(1,'one'),
(2,'two'),
(3,'three')
select * from @declareTable as dt;
@nosajhpled
nosajhpled / C# – Extract filename from a full path
Last active August 31, 2018 20:26
C# – Extract filename from a full path
Over the years extracting the filename from a full path has always been a pain for me. Working with C#, I discovered a one line, easy to use, solution.
FileName = FileName.Split('\\')[FileName.Split('\\').Count() - 1];
Filename = “c:\TextFile.txt”
Will return:
“TextFile.txt”
@nosajhpled
nosajhpled / AWS SFTP User
Created June 19, 2018 15:29
Create a new user to SFTP into an AWS EC2 Server
Create User
------------
sudo adduser <new user> && sudo su - <new user> && cd /home/<new user>
Create SSH
----------
mkdir .ssh && chmod 700 .ssh && touch .ssh/authorized_keys && chmod 600 .ssh/authorized_keys
ssh-keygen -f <new user> && cat <new user>.pub >> /home/<new user>/.ssh/authorized_keys
Copy Private Key To Give to New User
*/5 * * * * curl http://www.example.com
Add/Edit CRON job:
crontab -e
VIM Commands:
Insert a line - ESC -> I
Save - :w
Quit - :q