Skip to content

Instantly share code, notes, and snippets.

View Shaglock's full-sized avatar
🏠
Working from home

Ilya Shaplyko Shaglock

🏠
Working from home
View GitHub Profile
@Shaglock
Shaglock / README.md
Created March 22, 2022 08:45 — forked from jherax/README.md
Git Alias and Rebase

Git Alias and Git Rebase

WHEN TO DO REBASE

After each commit in our branch, in order to be up-to-date with the integration branch.

@Shaglock
Shaglock / stash_dropped.md
Created May 14, 2019 20:50 — forked from joseluisq/stash_dropped.md
How to recover a dropped stash in Git?

How to recover a dropped stash in Git?

1. Find the stash commits:

git log --graph --oneline --decorate ( git fsck --no-reflog | awk '/dangling commit/ {print $3}' )

This will show you all the commits at the tips of your commit graph which are no longer referenced from any branch or tag – every lost commit, including every stash commit you’ve ever created, will be somewhere in that graph.

@Shaglock
Shaglock / gist:bb166a220e61d8d95b5a4ef753ac931d
Created September 4, 2018 14:58
Regexp for replacing hash rocket syntax
/([^:]|^):(\w+)\s?(\s*)=>\s?(\s*)/g,
"$1$2: $3$4"
require 'net/ssh/gateway'
require 'active_record'
# there is no password here as the local user `user` has an SSH key stored on the remote server
gateway = Net::SSH::Gateway.new('domain.tld', 'user')
port = gateway.open('127.0.0.1', 3306, 3307)
ActiveRecord::Base.establish_connection(
adapter: 'mysql2',
host: '127.0.0.1',
@Shaglock
Shaglock / component-example.sh
Created May 24, 2017 20:11
Ostis ui component sample install script
#clone ostis
git clone https://github.com/ShunkevichDV/ostis.git
cd ostis/scripts
./prepare.sh
#clone component
cd ..
git clone https://github.com/MikhailSadovsky/ostis-UI-component-sample.git
#integrate component
mv ostis-UI-component-sample/example.component/ ./
mv ostis-UI-component-sample/example_code.scs kb/