Skip to content

Instantly share code, notes, and snippets.

@actionm
actionm / deploy.sh
Created February 28, 2017 19:01
Zero downtime deployment script
# Deployment with zero downtime
# By default keeps 2 last deployments in KEEP_DEPLOYMENTS_DIR and current deployment
# Project domain
PROJECT_NAME=test.com
# Project directory
PROJECT_DIR=/home/forge/test.com
# Deployments directory
KEEP_DEPLOYMENTS_DIR=/home/forge/deploy
$(function() {
smoothScroll(300);
});
function smoothScroll(duration) {
$('a[href^="#"]').on("click", function(event) {
var target = $($(this).attr("href"));
if (target.length) {
event.preventDefault();
@actionm
actionm / DispatchCustomAction.php
Created November 17, 2019 15:33
Dispatch Laravel Nova Action from anywhere
<?php
namespace App\Helpers\Nova\Action;
use DateTime;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Queue;
use Laravel\Nova\Actions\Action;
use Laravel\Nova\Actions\ActionEvent;