This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # ============= | |
| # Run terminal as admin, then run 'powershell.exe -ExecutionPolicy Unrestricted' | |
| # to start powershell session in unrestricted mode | |
| # https://learn.microsoft.com/th-th/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-7.4 | |
| if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs; exit } | |
| # get all input parameter | |
| $computerName = Read-Host 'Change Computer Name from [' $env:COMPUTERNAME '] to (blank to skip) ' | |
| $monitorTimeout = Read-Host 'Set monitor timeout to __ second (blank to skip) ' | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | const pause = (data, time) => new Promise(resolve => setTimeout(() => resolve(data), time)); | |
| const pauseReject = (data, time) => | |
| new Promise((resolve, reject) => | |
| setTimeout(() => reject(new Error(`Something went wrong in the ${data} promise`)), time) | |
| ); | |
| const parallelErrorHandlingWrong = () => { | |
| const firstPromise = pause('first', 3000); | |
| const secondPromise = pauseReject('second', 2000); | |
| const thirdPromise = pause('third', 1000); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | /** | |
| * Prefetch pages to make navigation faster (from route to route) | |
| * Monkey patch router-link to trigger async import when the link is in the viewport | |
| * Use a queue & requestIdleCallback to prevent browser from freezing | |
| * Install in Vue 3 with `import prefetch from './prefetch` then `app.use(prefetch)` | |
| * */ | |
| import { watchPausable } from '@vueuse/core'; | |
| import { ref } from 'vue'; | |
| import { RouterLink, useRouter } from 'vue-router'; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | function buildTree(array, parentRetriever = e => e.parentId) { | |
| if (!array || array.length === 0) { | |
| return [] | |
| } | |
| array.forEach(e => { | |
| e.children = [] // 为每个节点初始化children属性 | |
| }) | |
| const adjacencyTable = {} | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // missing from JS stdlib | |
| // return an array of numbers starting at `start`, not reaching `end`, incrementing by `step`. | |
| export function range(start: number, end: number, step: number = 1): number[] { | |
| return [...Array(Math.ceil((end - start) / step)).keys()].map(i => i * step + start); | |
| } | |
| // return the average of an array of numbers. | |
| export function average(array: number[]): number { | |
| return array.reduce((sum, n) => sum + n) / array.length; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // Takes an array with possible nested arrays, and returns a **new** flat array. | |
| const flatten = array => | |
| array.reduce( | |
| (flattened, elem) => | |
| flattened.concat(Array.isArray(elem) ? flatten(elem) : elem), | |
| [] | |
| ); | |
| // From here on below we have only test utilities | |
| const test = (testedFunc, input, expectedOutput, comparator) => { | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | @-moz-document url-prefix() { | |
| * { | |
| scrollbar-width: thin; | |
| scrollbar-color: #c1c1c1 rgba(0, 0, 0, 0.03); | |
| } | |
| } | |
| ::-webkit-scrollbar { | |
| width: 10px; | |
| height: 10px; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // ==UserScript== | |
| // @name Absolute Enable Right Click & Copy | |
| // @namespace Absolute Right Click | |
| // @description Force Enable Right Click & Copy & Highlight | |
| // @shortcutKeys [Ctrl + `] Activate Absolute Right Click Mode To Force Remove Any Type Of Protection | |
| // @author Absolute | |
| // @version 1.8.9 | |
| // @include *://* | |
| // @icon https://i.imgur.com/AC7SyUr.png | |
| // @compatible Chrome Google Chrome + Tampermonkey | 
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 ZIPabove to download the scripts needed - create a folder inside your USB/external drive or whatever, name it 
myVMBOX(ex.F:\myVMBOXif your USB is inF:\). - inside 
F:\myVMBOXput the virtualbox exe we just downloaded (VirtualBox-7.0.8-156879-Win.exe) and rename it toVirtualBox.exe. - inside 
F:\myVMBOXput the following filesstart_virtualbox.batanduninstall_virtualbox.bat, you will find them inside the zip you just downloaded. - now everytime you want to start virtualbox use 
start_virtualbox.bat.