Skip to content

Instantly share code, notes, and snippets.

@VacantThinker
VacantThinker / use cmd create a blank file.md
Created December 29, 2023 17:50
use cmd create a blank file
@VacantThinker
VacantThinker / jquery in firefox extension content scripts.md
Created May 15, 2023 23:16
jquery in firefox extension content scripts.md
  "content_scripts": [
    {
      "matches": [
        "http://*/*",
        "https://*/*"
        ],
      "js": [
        "jquery-1.4.2.js", 
 "extension.js"
@VacantThinker
VacantThinker / How to insert an item into an array at a specific index (JavaScript).md
Created May 15, 2023 06:09
How to insert an item into an array at a specific index (JavaScript)
var arr = [];
arr[0] = "Jani";
arr[1] = "Hege";
arr[2] = "Stale";
arr[3] = "Kai Jim";
arr[4] = "Borge";

console.log(arr.join()); // Jani,Hege,Stale,Kai Jim,Borge
arr.splice(2, 0, "Lene");
@VacantThinker
VacantThinker / Export project from StackBlitz to local.md
Created May 4, 2023 05:20
Export project from StackBlitz to local

7V9ah

from:
https://stackoverflow.com/questions/52560532/export-angular-project-from-stackblitz-to-local
entry: {
    'module/a/index': 'module/a/index.js',
    'module/b/index': 'module/b/index.js',
},
output: {
    path: path.resolve(__dirname, 'dist'),
    filename: '[name].js'
}
document.querySelector('head')
.insertAdjacentHTML('beforeend',
`<style>
#highlighter-top, #highlighter-bottom {
background: red;
height:1px;
position: fixed;
transition:all 300ms ease;
}
#highlighter-left, #highlighter-right {