Skip to content

Instantly share code, notes, and snippets.

View alsolovyev's full-sized avatar
💭
Enjoy life, Eat well & Laugh often ¯\_(ツ)_/¯

Aleksey Solovyev alsolovyev

💭
Enjoy life, Eat well & Laugh often ¯\_(ツ)_/¯
View GitHub Profile
@alsolovyev
alsolovyev / info.bat
Created March 30, 2023 13:01
Get Memory and CPU Usage in Windows 10 via Batch (cmd)
@echo off
setlocal
for /f "tokens=2 delims=:" %%a in ('systeminfo ^| find "Available Physical Memory"') do set "avail_mem=%%a"
if %errorlevel% neq 0 (
echo Error: Failed to get available physical memory
) else (
echo Available memory: %avail_mem%
)
@alsolovyev
alsolovyev / vim.applescript
Created September 10, 2022 20:08
Raycast script to open Vim or files in Vim
#!/usr/bin/osascript
# Dependency: requires iTerm (https://iterm2.com)
# Install via Homebrew: `brew install --cask iterm2`
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Open Vim
# @raycast.mode compact
@alsolovyev
alsolovyev / usefulGitCommands.md
Last active January 25, 2025 12:04
Useful Git Commands

Deploying a subfolder to GitHub Pages

git subtree push --prefix release origin gh-pages

Force push to GitHub Pages

git subtree split --prefix release -b gh-pages 
git push -f origin gh-pages:gh-pages
@alsolovyev
alsolovyev / .Helpful JavaScript Functions.md
Last active May 14, 2021 20:30
Helpful JavaScript functions

Helpful JavaScript functions

copy- copy to clipboard
createElement - create the HTML element specified by tagName formatPhoneNumber - formats a string into a human-readable phone number getRandomBool - get a random boolean value
getRandomFloat - get a random floating point number between min and max
getRandomInt - get a random integer between min and max
isArray - checks if data is classified as an Array primitive
isNumber - checks if data is classified as a Number primitive

@alsolovyev
alsolovyev / .getEventListeners.md
Last active June 18, 2025 12:44
Get all event listeners on a page

Get all event listeners on a page

@alsolovyev
alsolovyev / .ThreeJS Boilerplate.md
Last active April 25, 2025 14:55
A simple Three.js boilerplate with a bunch of comment

Three.js boilerplate

https://threejs.org/

@alsolovyev
alsolovyev / .batch.md
Last active October 16, 2024 03:09
Batch scripts

Bash Scripts

ls - list directory contents
mk - create a directory and move into it
rm - remove files or directories
s - open files or directories in sublime text 3
st - open Twitch streams in a video player(mpv default)
touch - create files
yt - download videos from YouTube.com
zip - create a password-protected ZIP file(7zip)

@alsolovyev
alsolovyev / .readme.md
Last active March 30, 2021 20:28
Parcel config files for nunjucks templates

Parcel config files for nunjucks templates

  1. Change yarn vesrion:
    yarn set version berry
  2. Install dependencies:
    yarn add -D babel-types nunjucks parcel-bundler parcel-plugin-data-src parcel-plugin-nunjucks parcel-plugin-svg-sprite sass
  3. Run dev:
    yarn start
@alsolovyev
alsolovyev / .Clean Up Context Menu.md
Last active November 8, 2022 10:46
Clean Up Windows Context Menu

Clean Up Windows Context Menu

  • add windows terminal
  • add sublime text
  • add VSCode
  • add Vim
  • add file types(generic, js, html, sass, vue) to the new item menu
  • remove unnecessary options
  • enable Windows Photo Viewer
  • disables web search in start menu