Skip to content

Instantly share code, notes, and snippets.

View besrabasant's full-sized avatar
🏠
Working from home

Basant Besra besrabasant

🏠
Working from home
View GitHub Profile
export function bridgeTurboAndAlpine(Alpine) {
document.addEventListener('turbo:before-render', (event) => {
Alpine.deferMutations();
});
document.addEventListener('turbo:render', () => {
if (document.documentElement.hasAttribute('data-turbo-preview')) {
return;
}
<?php
namespace App\Providers;
use App\Support\Utils\OctaModal;
use App\Support\Utils\OctaResponse;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Session;
use Illuminate\Support\ServiceProvider;
use Inertia\Inertia;
{
// Disable admin for test
"admin": {
"disabled": true
},
"apps": {
"http": {
// Use http to avoid having to provision an ssl cert
"http_port": 4444,
"servers": {
@allthingsclowd
allthingsclowd / ssh-certificate-authentication.md
Last active March 17, 2024 11:39
How to configure SSH Certificate based Authentication - Great for large scale deployment and management of servers

SSH Certificate based Authentication - Quick Guide

Certificate Authority (CA) Server Host Server(s) Client(s)
Host Server Certificate Configuration
This is the server typically managed by a security team. The root CA private keys are held on this server and should be protected. If these keys are compromised it will be necessary to Revoke & Rotate/Recreate ALL Certificates!! These are the servers that are being built or reprovisioned. The Host CA Signed Certificate is used to prove Host Authenticity to clients. It is sent to the ssh client during the initial handshake when a ssh client attempts to login. The user laptop or server that's runing the ssh client. The Client CA Signed Certificate is used to prove Client Authenticity to the Host Server
Step 1. Create HOST CA signing keys : Example ssh-keygen -t rsa -N '' -C HOST-CA -b 4096 -f host-ca Step 2. Let's generate a fresh set of ssh RSA HOST keys with 4096 bits. Typically the keys are generated by default
@ikiselev1989
ikiselev1989 / bem-and-sass.md
Last active April 30, 2019 12:47 — forked from radist2s/bem-and-sass.md
BEM & SASS best practices

BEM & SASS best practices

Every block should be in separated file named as block.

Filename: rating-star.scss

.rating-star {
    $font-size: 0.5em;
    
    display: inline-block; // `display` style may be set freely
<?php
# File: app\Http\Middleware\CORS.php
# Create file with below code in above location. And at the end of the file there are other instructions also.
# Please check.
namespace App\Http\Middleware;
use Closure;
class CORS {
@blpabhishek
blpabhishek / git-merge.sh
Created July 31, 2017 11:52
Merge two unrelated git repositories
# merge project-a to a project-b with all the history
cd path/to/project-b
git remote add project-a path/to/project-a
git fetch project-a
git merge --allow-unrelated-histories project-a/master
git remote remove project-a
git add .
git commit -m <message>
@josephrace
josephrace / .gitlab-ci.yml
Created May 18, 2017 17:44
Configuration file for create-react-app on GitLab Pages
image: node:7.9.0 # change to match your node version
cache:
paths:
- node_modules/
before_script:
- npm install
test:
@technoknol
technoknol / Enable CORS in Laravel 5.4.php
Created April 26, 2017 14:10
Enable CORS in laravel 5.4
<?php
# File: app\Http\Middleware\CORS.php
# Create file with below code in above location. And at the end of the file there are other instructions also.
# Please check.
namespace App\Http\Middleware;
use Closure;
class CORS {
@jgrodziski
jgrodziski / docker-aliases.sh
Last active November 9, 2024 17:50
Useful Docker Aliases
############################################################################
# #
# ------- Useful Docker Aliases -------- #
# #
# # Installation : #
# copy/paste these lines into your .bashrc or .zshrc file or just #
# type the following in your current shell to try it out: #
# wget -O - https://gist.githubusercontent.com/jgrodziski/9ed4a17709baad10dbcd4530b60dfcbb/raw/d84ef1741c59e7ab07fb055a70df1830584c6c18/docker-aliases.sh | bash
# #
# # Usage: #