Skip to content

Instantly share code, notes, and snippets.

@gerwld
gerwld / javascriptreact.json
Last active October 7, 2024 16:17
React snippets for VSCode
// To open and edit javascriptreact.json in VS Code:
// Press Ctrl+Shift+P (or Cmd+Shift+P on Mac) to open the Command Palette.
// Type Preferences: Configure User Snippets and select it.
// Choose javascriptreact.json from the list.
{
/*
// Place your snippets for JavaScript here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
1) Close Parallels completely
2) In Terminal, type : sudo nano /Library/Preferences/Parallels/network.desktop.xml (this will open the Terminal text editor "nano")
3) Type your admin password to access the file
4) Locate this line <usekextless>-1</usekextless> it could be also value 1 and replace whatever value there with 0, so you should have <usekextless>0</usekextless>
5) Press Ctrl+O to ask for a save, then Ctrl+X to close the editor
In Terminal, type : sudo nano /Library/Preferences/Parallels/dispatcher.desktop.xml
find <usb>0</usb> and change 0 to 1
again Press Ctrl+O to ask for a save, then Ctrl+X to close the editor
6) Close Terminal and open Parallels like normal, your VM should load like on Catalina and before
@gerwld
gerwld / adobe_cc.md
Created August 26, 2024 08:39 — forked from gadzhimari/adobe_cc.md
Completely Remove Adobe from your Mac in 2 Steps

Step 1

Download and run the Adobe Creative Cloud Cleaner Tool, their multi-app uninstaller and wipe assistant. Adobe does recommend running individual application uninstallers first, your call. Click the Clean All option.

Step 2

Type a one line command in terminal find ~/ -iname "*adobe*" and it's shows up all files which match pattern.

To remove all files

`sudo rm -rf /Applications/Adobe* /Applications/Utilities/Adobe* /Library/Application\ Support/Adobe /Library/Preferences/com.adobe.* /Library/PrivilegedHelperTools/com.adobe.* /private/var/db/receipts/com.adobe.* ~/Library/Application\ Support/Adobe* ~/Library/Application\ Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.adobe* ~/Library/Application\ Support/CrashReporter/Adobe* ~/Library/Caches/Adobe ~/Library/Caches/com.Adobe.* ~/Library/Caches/com.adobe.* ~/Library/Cookies/com.adobe.* ~/Library/Logs/Adobe* ~/Librar

@gerwld
gerwld / .zshrc
Last active September 28, 2024 15:31
zsh config base
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:$PATH
# Path to Oh My Zsh installation & source
export ZSH="$HOME/.oh-my-zsh"
source $ZSH/oh-my-zsh.sh
# Path to Android SDK, platform-tools, commandlinetools
export ANDROID_HOME=/usr/local/share/android-commandlinetools
@gerwld
gerwld / instagram-comment-activity-deleter.js
Last active September 12, 2024 19:51 — forked from sbolel/instagram-comment-activity-deleter.js
Instagram Comment Activity Deleter: Automate the deletion of all your Instagram comments from the 'Your Activity' section. Perfect for quick digital clean-up.
/**
* This script automates the process of deleting your own Instagram comments.
* It deletes comments in batches to avoid hitting rate limits or breaking the page.
*
* WARNING: This function directly manipulates the DOM and depends on the current HTML
* structure of Instagram's website to work. If Instagram implements changes to the
* activity page layout, structure, or functionality, this script may break or cause
* unexpected behavior. Use at your own risk and always review code before running it.
*
* How to use:
@gerwld
gerwld / instagram-likes-activity-deleter.js
Last active September 12, 2024 20:01
Instagram Likes Activity Deleter: Automate the deletion of all your Instagram likes from the 'Your Activity' section. Perfect for quick digital clean-up.
/**
* This script automates the process of deleting your own Instagram likes.
* It deletes comments in batches to avoid hitting rate limits or breaking the page.
*
* WARNING: This function directly manipulates the DOM and depends on the current HTML
* structure of Instagram's website to work. If Instagram implements changes to the
* activity page layout, structure, or functionality, this script may break or cause
* unexpected behavior. Use at your own risk and always review code before running it.
*
* How to use:
@gerwld
gerwld / .zshrc
Last active October 4, 2024 07:01
Upd. zshrc
export ZSH="$HOME/.oh-my-zsh"
ZSH_THEME="robbyrussell"
export PATH="/usr/local/opt/ruby/bin:$PATH"
#17 java
export JAVA_HOME=$(/usr/libexec/java_home -v 17)

Several key techniques and best practices to help make JavaScript run extremely fast. Some of these involve optimizing how you handle objects, memory, and data structures, as well as leveraging modern JavaScript engine optimizations. Here are some key points:

1. Use Object.create(null) for Pure Maps/State Objects

  • When you create objects using {}, they inherit from Object.prototype, which can introduce unnecessary properties and methods. Using Object.create(null) creates an object with no prototype, making it a cleaner and faster option for objects used purely as maps or state stores. This reduces overhead from the prototype chain.

2. Avoid Creating Objects in Loops

  • Repeatedly creating objects inside a loop can lead to excessive memory allocations and garbage collection. Instead, reuse objects where possible or move object creation outside the loop.

3. Minimize the Use of Closures in Performance-Critical Code

  • While closures are powerful, they can sometimes lead
@gerwld
gerwld / typescriptreact.json
Created October 18, 2024 14:20
Snippets for Typescript React
// To open and edit typescriptreact.json in VS Code:
// Press Ctrl+Shift+P (or Cmd+Shift+P on Mac) to open the Command Palette.
// Type Preferences: Configure User Snippets and select it.
// Choose typescriptreact.json from the list.
{
/*
// Place your snippets for Typescript here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are: