Skip to content

Instantly share code, notes, and snippets.

View ashokgelal's full-sized avatar
🌐
Building

Ashok Gelal ashokgelal

🌐
Building
View GitHub Profile
@ashokgelal
ashokgelal / alpas.sh
Created June 16, 2020 15:19
Alpas prod script
#!/usr/bin/env bash
runApp() {
MY_PATH=$(dirname "$0")
MY_PATH=$( (cd "$MY_PATH" && pwd))
APP_PATH="${MY_PATH}"
export alpas_run_mode="console"
export alpas_root_dir="$APP_PATH"
@ashokgelal
ashokgelal / renew.md
Created May 31, 2020 01:02
Renew SSL

acme.sh --install-cert -d example.com --key-file /etc/nginx/ssl/example.com/privkey.pem --fullchain-file /etc/nginx/ssl/example.com/fullchain.pem --reloadcmd 'service nginx force-reload' --accountemail you@example.com

@ashokgelal
ashokgelal / release.sh
Created January 12, 2020 21:26 — forked from bclinkinbeard/release.sh
Bash script to automate the Git Flow tag/release process
#!/bin/bash
# current Git branch
branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')
# v1.0.0, v1.5.2, etc.
versionLabel=v$1
# establish branch and tag name variables
devBranch=develop
@ashokgelal
ashokgelal / install-teamcity.md
Last active May 8, 2019 17:40 — forked from simoneb/install-teamcity.md
Install TeamCity on Ubuntu with Nginx
@ashokgelal
ashokgelal / post.md
Last active December 18, 2018 22:44 — forked from LostKobrakai/post.md
Using Laravel-Mix with Phoenix

Introduction

Laravel-Mix is "an elegant wrapper around Webpack for the 80% use case". It has nothing to do with Elixir's Mix and does not require Laravel to work!

Set up

Create a new phoenix application with mix phx.new. You may choose to add the --no-brunch flag to stop brunch from being intiailized, but I personally prefer leaving that in and replacing brunch so that the folder structure is set up for me.

$ mix phx.new demo

Install Laravel-Mix

@ashokgelal
ashokgelal / Envoy.blade.php
Created September 1, 2018 17:43 — forked from michaeldyrynda/Envoy.blade.php
Laravel 5 Envoy deploy configuration
@servers([ 'remote' => 'server.example.com', ])
@setup
if ( ! isset($repo) )
{
throw new Exception('--repo must be specified');
}
if ( ! isset($base_dir) )
{
<?php
use App\Permission;
use Illuminate\Database\Seeder;
use Spatie\Permission\Models\Role;
class TenantDatabaseSeeder extends Seeder
{
public function run()
{
@ashokgelal
ashokgelal / Role.php
Created December 16, 2017 18:32
We have to make Role model be aware of both permission management and multi-tenancy
<?php
namespace App;
use Hyn\Tenancy\Traits\UsesTenantConnection;
use Spatie\Permission\Models\Role as BaseRole;
class Role extends BaseRole
{
use UsesTenantConnection;
<?php
namespace App\Console\Commands;
use Hyn\Tenancy\Contracts\Repositories\CustomerRepository;
use Hyn\Tenancy\Contracts\Repositories\HostnameRepository;
use Hyn\Tenancy\Contracts\Repositories\WebsiteRepository;
use Hyn\Tenancy\Environment;
use Hyn\Tenancy\Models\Customer;
use Illuminate\Console\Command;
// add a new new key in config/app.php:
‘url_base’ => env(‘APP_URL_BASE’, ‘http://localhost'),
// modify your .env file:
APP_URL_BASE=townhouse.dev
APP_URL=http://${APP_URL_BASE}