Skip to content

Instantly share code, notes, and snippets.

View sarangnx's full-sized avatar
👨‍💻
Working From Home

Sarang N sarangnx

👨‍💻
Working From Home
View GitHub Profile
@cathrinevaage
cathrinevaage / App.vue
Last active April 17, 2024 04:40
Tabs in Vue 3 / Composition API
<!-- Usage -->
<template>
<Tabs>
<Tab name="Foo">Content of tab Foo</Tab>
<Tab name="Bar">Content of tab Bar</Tab>
</Tabs>
</template>
<script>
@madkoding
madkoding / pair-dual-boot-bluetooth.md
Last active April 28, 2024 20:47
Pairing bluetooth devices in dual boot with Linux Ubuntu and Windows 10/11

Pairing Bluetooth Devices in Dual Boot with Linux Ubuntu and Windows 10/11

Introduction

This guide provides updated instructions for pairing Bluetooth devices (such as keyboards or mice) in a dual-boot environment with Linux Ubuntu and Windows 10/11, incorporating community feedback and suggestions.

Instructions

1. Pair in Linux First

  • Pair your Bluetooth device in Linux. This is crucial to ensure the LinkKey remains consistent.
  • Note: Do not re-pair the device in Linux after completing the pairing in Windows.
@bmaupin
bmaupin / free-database-hosting.md
Last active May 4, 2024 01:18
Free database hosting
@supriya-premkumar
supriya-premkumar / dockerCheatSheet.md
Last active January 4, 2023 11:29
Docker Commands
@crypticmind
crypticmind / README.md
Last active March 25, 2024 06:26
Setup lambda + API Gateway using localstack
@greyscaled
greyscaled / README.md
Last active September 19, 2022 08:59
Sequelize + Express + Migrations + Seed Starter
@zcaceres
zcaceres / Include-in-Sequelize.md
Last active January 8, 2024 07:14
using Include in sequelize

'Include' in Sequelize: The One Confusing Query That You Should Memorize

When querying your database in Sequelize, you'll often want data associated with a particular model which isn't in the model's table directly. This data is usually typically associated through join tables (e.g. a 'hasMany' or 'belongsToMany' association), or a foreign key (e.g. a 'hasOne' or 'belongsTo' association).

When you query, you'll receive just the rows you've looked for. With eager loading, you'll also get any associated data. For some reason, I can never remember the proper way to do eager loading when writing my Sequelize queries. I've seen others struggle with the same thing.

Eager loading is confusing because the 'include' that is uses has unfamiliar fields is set in an array rather than just an object.

So let's go through the one query that's worth memorizing to handle your eager loading.

The Basic Query

@lyoshenka
lyoshenka / ngrok-selfhosting-setup.md
Last active February 1, 2024 20:14
How to setup Ngrok with a self-signed SSL cert

Intro

The plan is to create a pair of executables (ngrok and ngrokd) that are connected with a self-signed SSL cert. Since the client and server executables are paired, you won't be able to use any other ngrok to connect to this ngrokd, and vice versa.

DNS

Add two DNS records: one for the base domain and one for the wildcard domain. For example, if your base domain is domain.com, you'll need a record for that and for *.domain.com.

Different Operating Systems

@manjeshpv
manjeshpv / passport.js
Last active February 29, 2024 15:11
Passport.js using MySQL for Authentication with Express
// config/passport.js
// load all the things we need
var LocalStrategy = require('passport-local').Strategy;
var mysql = require('mysql');
var connection = mysql.createConnection({
host : 'localhost',
user : 'root',