Skip to content

Instantly share code, notes, and snippets.

View AKOPWeb's full-sized avatar
🏡
akop.com.br

AKOP AKOPWeb

🏡
akop.com.br
View GitHub Profile
@AKOPWeb
AKOPWeb / CitiesTableSeeder.php
Last active August 7, 2018 08:53
Lista de todas as cidades e estados do Brasil em um array. Neste exemplo, mostro um Seeder do Laravel para popular a tabela "cities" (id [INT, PK, auto_increment], name [string], state [char(2)])
<?php
use Illuminate\Database\Seeder;
class CitiesTablesSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
@AKOPWeb
AKOPWeb / ajax-save.js
Last active January 23, 2019 08:22
Ajax Save function that works for general form submissions (even image uploads)
function ajaxSave(method, url, formId, callback) {
// Form data...well...it's our form data 🤷🏼‍♂️
let formData = new FormData(document.getElementById(formId));
// Instantiate the XMLHttpRequest object and open it
let ajax = new XMLHttpRequest();
// @method = POST/GET; @url = 🌐; @async = true/false
ajax.open(method, url, true);
@AKOPWeb
AKOPWeb / webpack.mix
Created April 18, 2020 16:26
Webpack.mix.js example using PurgeCSS
const mix = require('laravel-mix')
const tailwindcss = require('tailwindcss')
const ImageminPlugin = require('imagemin-webpack-plugin').default
const CopyWebpackPlugin = require('copy-webpack-plugin')
const imageminMozjpeg = require('imagemin-mozjpeg')
const purgecssForAdmin = require('@fullhuman/postcss-purgecss')({
content : [
'./node_modules/noty/**/*.css', './node_modules/noty/**/*.scss',
'./node_modules/animate.css/**/*.css', './node_modules/animate.css/**/*.scss',
<ul class="flex">
<li class="flex flex-col relative text-center space-y-3">
<div class="bg-blue-100 rounded-lg p-3">COMPANY</div>
<ul class="flex space-x-3">
<li class="flex flex-col relative space-y-3">
<div class="bg-teal-300 rounded-lg p-2">Sales Department</div>
<ul class="flex space-x-3">
<li class="flex flex-col relative">
<div class="bg-teal-300 rounded-lg p-2">Sub Sales A</div>