Skip to content

Instantly share code, notes, and snippets.

View besrabasant's full-sized avatar
💻
Vibe coding

Basant Besra besrabasant

💻
Vibe coding
View GitHub Profile
@besrabasant
besrabasant / Readme.md
Last active August 28, 2025 02:49
A shell utility to run multiple independent Slack instances on Linux, each with its own configuration directory. Useful for logging into different workspaces without mixing data.

Virtual Slack Manager

A shell utility to run multiple independent Slack instances on Linux, each with its own configuration directory. Useful for logging into different workspaces without mixing data.

Features

virtual-slack.sh create <N> → creates a new Slack instance (Slack N) with its own config (~/.config-N)

virtual-slack.sh remove <N> → fully removes the instance and its config

@besrabasant
besrabasant / Laravel-Container.md
Created April 23, 2019 02:35
Laravel's Dependency Injection Container in Depth

Laravel's Dependency Injection Container in Depth

Translations: Korean (by Yongwoo Lee)

Laravel has a powerful Inversion of Control (IoC) / Dependency Injection (DI) Container. Unfortunately the official documentation doesn't cover all of the available functionality, so I decided to experiment with it and document it for myself. The following is based on Laravel 5.4.26 - other versions may vary.

Introduction to Dependency Injection

I won't attempt to explain the principles behind DI / IoC here - if you're not familiar with them you might want to read What is Dependency Injection? by Fabien Potencier (creator of the Symfony framework).

@besrabasant
besrabasant / NoDebugBar.php
Last active August 15, 2024 14:25
A handy middleware to disable Laravel Debugbar.
<?php
namespace App\Http\Middleware;
use Closure;
use Barryvdh\Debugbar\Facade as Debugbar;
class NoDebugbar
{
/**
{
// Disable admin for test
"admin": {
"disabled": true
},
"apps": {
"http": {
// Use http to avoid having to provision an ssl cert
"http_port": 4444,
"servers": {
@besrabasant
besrabasant / monaco-editor.vue
Created June 6, 2024 02:35
Monaco Editor Component in Vue3
<script lang="ts" setup>
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
import { computed, toRefs } from 'vue';
// Define an interface for the props
interface Props {
diffEditor?: boolean;
width?: string | number;
height?: string | number;
original?: string;
@besrabasant
besrabasant / ssh-certificate-authentication.md
Created March 17, 2024 11:39 — forked from allthingsclowd/ssh-certificate-authentication.md
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
@besrabasant
besrabasant / rafQueue.js
Created July 19, 2023 04:57
Utility script for queuing promises
/**
* requestAnimationFrame polyfill from Paul Irish
* http://paulirish.com/2011/requestanimationframe-for-smart-animating/
* MIT license
*/
var lastTime = 0,
vendors = ["ms", "moz", "webkit", "o"]
for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
window.requestAnimationFrame = window[vendors[x] + "RequestAnimationFrame"]
@besrabasant
besrabasant / about.md
Last active March 3, 2023 06:48
Submitting Forms with Turbolinks ( tested with Laravel );
@besrabasant
besrabasant / ReadMe.md
Created June 18, 2022 17:41
Asus M16 - Arch Linux / Manjaro - Configure System Keys Properly
@besrabasant
besrabasant / ReadMe.md
Created June 15, 2022 18:32
Bluetooth Volume too low (only in Arch Linux / Manjaro)