Skip to content

Instantly share code, notes, and snippets.

View AlexRogalskiy's full-sized avatar
🛰️
Work on stuff that matters

Alexander AlexRogalskiy

🛰️
Work on stuff that matters
View GitHub Profile

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

@AlexRogalskiy
AlexRogalskiy / alias.sh
Last active January 21, 2025 10:36
Alias
#-----------------------------------------------------------------------------------------------------
# if user is not root, pass all commands via sudo #
if [ $UID -ne 0 ]; then
alias reboot='sudo reboot'
alias update='sudo apt-get upgrade'
fi
#-----------------------------------------------------------------------------------------------------
### Get os name via uname ###
_myos="$(uname)"

Git attributes for .docx diffing

docx2txt

Download and install the docx2txt converter from http://docx2txt.sourceforge.net/

wget -O doc2txt.tar.gz http://docx2txt.cvs.sourceforge.net/viewvc/docx2txt/?view=tar
tar zxf docx2txt.tar.gz
cd docx2txt/docx2txt/

sudo make

# Important note: If you want the code in this project to be formatted as per the formatting configuration mentioned in this '.editorconfig' file, then open webstorm, go to 'File' => 'Setting' => 'Editor' => 'Code Style' => 'EditorConfig' => Set 'Enable EditorConfig Support' to true => Click 'Apply' => Click 'Ok'
# For Knowledge: The formatting settings of webstorm IDE of various file types, like Javascript, json, Typescript files, only apply when the above mentioned checkbox of 'Enable EditorConfig support' is set to false.
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = false
max_line_length = 120
@AlexRogalskiy
AlexRogalskiy / library.md
Created November 24, 2024 10:40 — forked from Rheola/library.md
Материалы по Go (golang)
@AlexRogalskiy
AlexRogalskiy / coroutine-pool.kts
Created November 12, 2024 06:21 — forked from fikr4n/coroutine-pool.kts
A quick example of thread pool-like Kotlin coroutine
import kotlinx.coroutines.experimental.*
import kotlinx.coroutines.experimental.channels.*
class FixedPool(val workerCount: Int) {
val channel = Channel<Task>()
val jobs = mutableListOf<Job>()
init {
start() // start immediately
@AlexRogalskiy
AlexRogalskiy / Counter.java
Created October 25, 2024 08:48 — forked from NicMcPhee/Counter.java
A simple example of a successful use of Java synchronization to eliminate race conditions. The "synchronized" keyword on Counter.incrementCount() is crucial here; removing it will lead to serious race conditions on multiple-core computers. Having it ensures that two threads can't enter this method at the same time, making sure that only one thre…
public class Counter {
private int count = 0;
public int getCount() {
return count ;
}
/**
* The "synchronized" keyword is crucial here; removing it will lead to serious
@AlexRogalskiy
AlexRogalskiy / terminal-commands.md
Created October 22, 2024 12:06 — forked from bradtraversy/terminal-commands.md
Common Terminal Commands

Common Terminal Commands

Key Commands & Navigation

Before we look at some common commands, I just want to note a few keyboard commands that are very helpful:

  • Up Arrow: Will show your last command
  • Down Arrow: Will show your next command
  • Tab: Will auto-complete your command
  • Ctrl + L: Will clear the screen
@AlexRogalskiy
AlexRogalskiy / README.md
Created September 11, 2024 14:26 — forked from matchilling/README.md
Setting autogenerated Id manually in Hibernate

Setting auto-generated Ids manually with Hibernate

In this tutorial, you will learn how to implement a custom IdentifierGenerator to support auto-generated and manually assigned Ids using Hibernate.

Continue reading ...

@AlexRogalskiy
AlexRogalskiy / types_and_roles_demo.sql
Created March 19, 2024 16:08 — forked from levlaz/types_and_roles_demo.sql
Create Types and Roles If Not Exist in PostgreSQL
BEGIN;
DO $$
BEGIN
IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'task_status') THEN
create type task_status AS ENUM ('todo', 'doing', 'blocked', 'done');
END IF;
END
$$;
CREATE TABLE IF NOT EXISTS