Skip to content

Instantly share code, notes, and snippets.

View romach's full-sized avatar

Roman Cherepanov romach

View GitHub Profile
@romach
romach / delete-all-files-in-current-directory.sh
Created April 4, 2017 17:11
Delete all files in current directory
find . -name "*" -delete
@romach
romach / set-max-connections.sql
Last active December 30, 2017 17:34
Set max connections in database
set global max_connections = 500;
@romach
romach / count-current-open-connections.sql
Created April 5, 2017 11:25
Count current open connections
show processlist;
@romach
romach / intellij-idea-line-shortcut.txt
Created April 5, 2017 12:22
Shortcut on line in Intellij IDEA
# Create shortcut
Ctrl + Shift + 1
# Go to shortcut
Ctrl + 1
@romach
romach / copy-list.java
Created April 5, 2017 14:08
Copy list
final List<Object> copy = new ArrayList<>();
copy.addAll(original);
@romach
romach / rename-current-branch.sh
Created April 5, 2017 15:57
Rename current branch
git branch -m <newname>
@romach
romach / last-files-in-directory.sh
Last active April 9, 2017 10:24
Find last files in directory
ls directory -Art | tail -n 50
@romach
romach / folder-size.sh
Created April 6, 2017 00:21
Folder size
du -sh folder
@romach
romach / zip-directory.sh
Created April 6, 2017 00:29
Zip directory
zip -r directory.zip directory
@romach
romach / create-map.java
Last active April 24, 2017 18:46
Create map to fit PMD UseConcurrentHashMap rule
final Map<String, Object> map = Maps.newHashMap();
map.put("value", new Integer());
ImmutableMap.of("param", 2.0)