Skip to content

Instantly share code, notes, and snippets.

@hivehand
hivehand / qrenc-wifi
Created May 1, 2024 10:08
Scriptlet for creating QR codes that let people join a WiFi network just by scanning the code.
#! /usr/bin/env ruby
# Take a network SSID as an argument, and prompt for the corresponding
# password. Generate a WiFi-network credential set suitable for QR
# encodring as defined in:
#
# https://github.com/zxing/zxing/wiki/Barcode-Contents#wi-fi-network-config-android-ios-11
#
# then generate that QR code and save it to `<SSID>-QR.png`.
#
@yagehu
yagehu / default.custom.yaml
Last active May 1, 2024 10:23
RIME fcitx 默认简体中文设置 (Config to make fcitx-rime default to simplified Chinese)
patch:
schema_list:
- schema: luna_pinyin_simp
- schema: luna_pinyin
- schema: luna_pinyin_fluency
- schema: bopomofo
- schema: bopomofo_tw
- schema: cangjie5
- schema: stroke
- schema: terra_pinyin
@lukas-h
lukas-h / license-badges.md
Last active May 1, 2024 10:20
Markdown License Badges for your Project

Markdown License badges

Collection of License badges for your Project's README file.
This list includes the most common open source and open data licenses.
Easily copy and paste the code under the badges into your Markdown files.

Notes

  • The badges do not fully replace the license informations for your projects, they are only emblems for the README, that the user can see the License at first glance.

Translations: (No guarantee that the translations are up-to-date)

@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();