Skip to content

Instantly share code, notes, and snippets.

View secondnetwork's full-sized avatar

Andreas Farah secondnetwork

View GitHub Profile

Convert MP4 to WMV on MacOS

Install ffmpeg

  1. Open Spotlight:

    Open Spotlight

  2. Search Terminal and press enter:

<?php
// Function `parse_yturl()` from <http://stackoverflow.com/a/10524505/624466>
/**
* Check if the input string is a valid YouTube URL
* and try to extract the YouTube Video ID from it.
*
* @author Stephan Schmitz <eyecatchup@gmail.com>
* @param $url string The string that shall be checked.
@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

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 / 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]);
});
@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 / 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
document.addEventListener('alpine:init', () => {
window.Alpine.data('autocompleter', ({
selectedResults,
max,
min,
ownerId,
url,
elName,
filterEls = [],
addUrl = "",
@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>
@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;