Skip to content

Instantly share code, notes, and snippets.

View secondnetwork's full-sized avatar

Andreas Farah secondnetwork

View GitHub Profile
@secondnetwork
secondnetwork / README.md
Created March 4, 2023 18:12 — forked from petehouston/README.md
homebrew mariadb reset root password

Quick guide to reset MariaDB root password on MacOS.

This tip can be used if you forget or want to change MariaDB root password.

Make sure to install MariaDB using Homebrew.

This tip is from Update root password in MariaDB 10.4 on MacOS

For MariaDB prior to v10.4

Font Face

A mixin for writing @font-face rules in SASS.

Usage

Create a font face rule. Embedded OpenType, WOFF2, WOFF, TrueType, and SVG files are automatically sourced.

@include font-face(Samplino, fonts/Samplino);
@secondnetwork
secondnetwork / webpack.mix.js
Created April 3, 2022 08:32
Laravel Valet + Laravel Mix + BrowserSync
const mix = require('laravel-mix');
/* ... */
if (! mix.inProduction()) {
let homedir = require('os').homedir();
// e.g SESSION_DOMAIN = myapp.test
let domain = process.env.SESSION_DOMAIN;
@secondnetwork
secondnetwork / alpine-accordion.html
Created March 23, 2022 16:41 — forked from w3collective/alpine-accordion.html
Accordion component built with Alpine.js & Tailwind CSS
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Alpine.js Accordion</title>
<link href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" rel="stylesheet" />
<script src="https://unpkg.com/alpinejs" defer></script>
</head>
<body>
document.addEventListener('alpine:init', () => {
window.Alpine.data('autocompleter', ({
selectedResults,
max,
min,
ownerId,
url,
elName,
filterEls = [],
addUrl = "",
@secondnetwork
secondnetwork / alpinejs-datepicker.html
Created January 9, 2022 12:37 — forked from mithicher/alpinejs-datepicker.html
Datepicker with Alpine.js and Tailwind CSS
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>CodePen - Datepicker with TailwindCSS and AlpineJS</title>
<link
href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css"
rel="stylesheet"
/>
<script
@secondnetwork
secondnetwork / table-simple.blade.php
Created January 9, 2022 12:37 — forked from mithicher/table-simple.blade.php
Simple Laravel Blade Table Component With Alpine.js and TailwindCSS
{{--
Simple Example:
<x-table-simple
striped // default: false
:columns='[
[
"name" => "Name",
"field" => "name",
"columnClasses" => "", // classes to style table th
"rowClasses" => "" // classes to style table td
@secondnetwork
secondnetwork / AppServiceProvider.php
Created September 30, 2021 09:30 — forked from wmandai/AppServiceProvider.php
Laravel, Livewire, Alpine JS Toast Notifications
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Component::macro('notify', function ($message, $title = '', $type = 'success') {
$this->dispatchBrowserEvent('notify', ['message' => $message, 'title' => $title, 'type' => $type]);
});

macOS Installation Tips & Advice

Listing Available macOS Installers

From Terminal, issuing the following command will list out available macOS Installers for the Mac:

softwareupdate --list-full-installers
@secondnetwork
secondnetwork / Install Composer using MAMP's PHP.md
Created July 14, 2019 17:49 — forked from irazasyed/Install Composer using MAMP's PHP.md
Instructions on how to change preinstalled Mac OS X PHP to MAMP's PHP Installation and then install Composer Package Management

Change default Mac OS X PHP to MAMP's PHP Installation and Install Composer Package Management


Instructions to Change PHP Installation


First, Lets find out what version of PHP we're running (To find out if it's the default version).

To do that, Within the terminal, Fire this command:

which php