Skip to content

Instantly share code, notes, and snippets.

@htr3n
htr3n / macos-ramdisk.md
Last active May 1, 2024 10:16
Creating RAM disk in macOS

Built-in

diskutil erasevolume HFS+ 'RAM Disk' `hdiutil attach -nobrowse -nomount ram://XXXXX`

where XXXXX is the size of the RAM disk in terms of memory blocks.

Notes:

@Clybius
Clybius / index.html
Last active May 1, 2024 10:14
Embed AV1/No File Size Capped Videos in Discord
<head>
<meta property="og:image" content="GifToEmbedURL"> # Change the content to the link of a gif of your choice, which will be shown as the embed.
<meta property="og:type" content="video.other">
<meta property="og:video:url" content="VideoToEmbedURL"> # Change the content to the link of a video of your choice. Will work with videos over 50 MB, and even unsupported codecs such as AV1!
<meta property="og:video:width" content="1920"> # Set this to the video's width and height, not required, but will show the video as intended if the aspect ratio and size is correct.
<meta property="og:video:height" content="1080">
</head>
@ALiangLiang
ALiangLiang / vpn.ps1
Last active May 1, 2024 10:12
Create and connect VPN with powershell script
# Author: ALiangLiang <me@aliangliang.top>
# Replace VPN_NAME, ADDRESS and ACCOUNT first!!
# Ref: https://docs.microsoft.com/en-us/powershell/module/vpnclient/add-vpnconnection?view=win10-ps
$VPN_NAME = 'VPN'
$ADDRESS = 'vpn.example.com'
$ACCOUNT = 'user1'
function Connect {

Interview Questions

Node.js

Q1: What do you mean by Asynchronous API? ☆☆

Answer: All APIs of Node.js library are aynchronous that is non-blocking. It essentially means a Node.js based server never waits for a API to return data. Server moves to next API after calling it and a notification mechanism of Events of Node.js helps server to get response from the previous API call.

Source: tutorialspoint.com

@RiadHossain43
RiadHossain43 / multi-tenancy.md
Last active May 1, 2024 10:11
MongoDB Multi Tenancy Approach

Stroy

Imagine you are building a simple project management application that has follwing simple features

  • Manage projects (your organisation may have multiple projects running)
  • Manage work packages related to a project
  • Manage members in your organisation that may need to have access to projects in your organisation.

Shared database approach

@badrelmers
badrelmers / Portable_Virtualbox.md
Last active May 1, 2024 10:10
portable virtualbox using the latest virtualbox installers

This makes virtualbox works in a portable mode:

  • if you have any installed virtualbox then uninstall it first
  • download https://download.virtualbox.org/virtualbox/7.0.8/VirtualBox-7.0.8-156879-Win.exe or any newer or older version
  • click on Download ZIP above to download the scripts needed
  • create a folder inside your USB/external drive or whatever, name it myVMBOX (ex. F:\myVMBOX if your USB is in F:\).
  • inside F:\myVMBOX put the virtualbox exe we just downloaded (VirtualBox-7.0.8-156879-Win.exe) and rename it to VirtualBox.exe.
  • inside F:\myVMBOX put the following files start_virtualbox.bat and uninstall_virtualbox.bat, you will find them inside the zip you just downloaded.
  • now everytime you want to start virtualbox use start_virtualbox.bat.
@erickoledadevrel
erickoledadevrel / UnmergedRanges.gs
Last active May 1, 2024 10:08
[Apps Script] Getting the unmerged ranges within a range
/**
* Gets all the unmerged ranges within a range.
* @param {SpreadsheetApp.Range} range The range to evaluate.
* @returns {SpreadsheetApp.Range[]} The unmerged ranges.
*/
function getUnmergedRanges(range) {
if (!range.isPartOfMerge()) {
return [range];
}
var mergedRanges = range.getMergedRanges();
@LukeZGD
LukeZGD / ios-downgrade-dualboot.md
Last active May 1, 2024 10:07
Downgrade and dualboot status of almost all iOS devices

Downgrade and dualboot status of almost all iOS devices

UPDATED: 2024-04-09

@kxttens
kxttens / smol.css
Last active May 1, 2024 10:06
A theme that makes Discord friendlier to smaller window widths.
:root {
--collapsed-sidebar-width: 48px;
--collapsed-member-list-width: 48px;
--sidebar-width: 240px;
--ui-margin-value: 10px;
--ui-floating-radius: 8px;
}
[class^=base_]>[class^=content_]>[class^=sidebar_] {
width: var(--collapsed-sidebar-width);
@Dawn-India
Dawn-India / Deploy With CLI
Last active May 1, 2024 10:04
Heroku Deploy
- Install CLI using official docs: https://devcenter.heroku.com/articles/heroku-cli
- Clone this repo: git clone https://gitlab.com/Dawn-India/Z-Mirror Z-Mirror/ && cd Z-Mirror
- Switch to deploy branch: git checkout hk_deploy
- Now add your config and all other private files.
- After adding your private files: git add . -f