Skip to content

Instantly share code, notes, and snippets.

View vasiliishvakin's full-sized avatar

Vasilii Shvakin vasiliishvakin

View GitHub Profile
@rohgoyal
rohgoyal / gist-with-vscode.md
Last active May 14, 2024 13:42
Manage Github Gist with VSCode

Visual Studio Code to manage Github Gist

Install Github Gist Extension

Search and install Gist (kenhowardpdx.vscode-gist) extension from Marketplace.

Setting up Github Connection

  1. From your Github profile, go to Settings and Develpoper Setttings
@WillPresley
WillPresley / wsl-backup-and-compress.ps1
Last active September 6, 2024 08:55
Backup WSL2 Virtual Disks and Compress with 7-Zip
# Backup WSL2 virtual disks using native functions and compress them using 7zip
## Will Presley, 2020
## willpresley.com
#### http://mats.gardstad.se/matscodemix/2009/02/05/calling-7-zip-from-powershell/
# Alias for 7-zip
if (-not (test-path "$env:ProgramFiles\7-Zip\7z.exe")) {throw "$env:ProgramFiles\7-Zip\7z.exe needed"}
set-alias sz "$env:ProgramFiles\7-Zip\7z.exe"
#### Alternative native PS 7-zip: https://www.sans.org/blog/powershell-7-zip-module-versus-compress-archive-with-encryption/
@gusenov
gusenov / git-cheat-sheet.sh
Last active September 20, 2024 11:55
Шпаргалка по Git.
#---------------------------------------------------------------------
# НАСТРОЙКИ
#---------------------------------------------------------------------
# Показать глобальную конфигурацию:
git config --global --list
git config --local user.name "user name"
git config --local user.email "user@email.com"
git config --local core.fileMode false
W3 Schools
https://www.w3schools.com/php/php_quiz.asp
PHP Online Quiz
https://www.tutorialspoint.com/php/php_online_quiz.htm
WS Cube Tech
http://www.wscubetech.com/quiz-test-php
After Hours Programming
@fevangelou
fevangelou / my.cnf
Last active September 21, 2024 22:10
Optimized my.cnf configuration for MySQL/MariaDB (on Ubuntu, CentOS, Almalinux etc. servers)
# === Optimized my.cnf configuration for MySQL/MariaDB (on Ubuntu, CentOS, Almalinux etc. servers) ===
#
# by Fotis Evangelou, developer of Engintron (engintron.com)
#
# ~ Updated December 2021 ~
#
#
# The settings provided below are a starting point for a 8-16 GB RAM server with 4-8 CPU cores.
# If you have different resources available you should adjust accordingly to save CPU, RAM & disk I/O usage.
#
@waleedrehmankhan
waleedrehmankhan / Validator.php
Last active January 25, 2023 23:27
Custom Laravel Alphanumeric Validator that allow spaces
Paste this Code in Validator.php
public function validateAlphaSpaces($attribute, $value, $params)
{
return preg_match('/^[\pL\s]+$/u', $value);
}
Create Custom Message some where at bottom in Validation.php
/*
-Xms2G
-Xmx2G
-XX:ReservedCodeCacheSize=500m
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-Djsse.enableSNIExtension=false
-XX:+UseCodeCacheFlushing
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
@Iristyle
Iristyle / Start-Vagrant.bat
Created March 15, 2013 18:35
Windows startup script to fire up a Vagrant VM safely on boot (using Run registry key for instance)
ECHO OFF
cd /d %~dp0
for /f "tokens=2* delims= " %%F IN ('vagrant status ^| find /I "default"') DO (SET "STATE=%%F%%G")
ECHO Close this window if it remains open, and http://localhost:8081 is responsive
IF "%STATE%" NEQ "saved" (
ECHO Starting Vagrant VM from powered down state...
vagrant up
) ELSE (
@remi
remi / commit-msg
Created August 30, 2011 20:56
Git commit message spell check hook (kind of a proof of concept, but still usable)
#!/usr/bin/env ruby
# 1. Install hunspell
# $ brew install hunspell
# 2. Download a dictionary and install it in a path listed by `hunspell -D`
# $ open http://wiki.services.openoffice.org/wiki/Dictionaries
# 3. Move this file into your repository
# $ mv commit-msg /path/to/repo/.git/hooks