Skip to content

Instantly share code, notes, and snippets.

View ihorzenich's full-sized avatar

Ihor Zenich ihorzenich

View GitHub Profile
@ihorzenich
ihorzenich / customFancybox.js
Last active August 29, 2015 14:14
Wrapper for showing custom fancybox popup
/**
* Wrapper for showing custom fancybox popup
* Parametrs: (header,content,buttonText,settings)
* header - popup header text
* content - popup content html
* buttonText - name of popup bottom button, set '' or not set for remove button
* settings:
* - style: popup css modificator for style, 'default' by default
* - event: popup css modificator for set popup identification, 'default' by default
* - hasCloseButton: TRUE by default, set FALSE for hidding close button
@ihorzenich
ihorzenich / regexp-cheatsheat.md
Created March 15, 2017 15:31
Regexp cheatsheets

UNMinified CSS

Replace [}] to }\n

@ihorzenich
ihorzenich / Update branch to master.md
Last active November 26, 2019 09:18
Update branch to master

Current branch will be updated to master, and then all new commits in it will be moved to head.

Not pushed

git fetch
git rebase origin/master

Pushed

@ihorzenich
ihorzenich / Replace master with develop.md
Created April 18, 2017 12:37
Replace master with develop
git checkout develop
git merge -s ours master -m "Replace master with develop" --log
git checkout master
git merge develop
git push --all
@ihorzenich
ihorzenich / Edit last pushed commit.md
Last active April 24, 2017 09:50
Edit last pushed commit
git rebase -i 07631121ef7b2d8e850c6cdd744ca202d68ad654^ #replace numbers with SHA-1 of your commit
# use X for deleting chars
# use A for entering INSERT mode
# replace `pick` with `edit`
# press ESC to exit INSERT mode
# press `:wq` for Save & Exit
git reset HEAD^
git add ...
git commit -m "First part"
@ihorzenich
ihorzenich / Encode video for background html5 video.md
Last active October 28, 2022 10:08
Encode video for background html5 video

Install ffmpeg with ALL includes

brew install ffmpeg $(brew options ffmpeg | grep -vE '\s' | grep -- '--with-' | tr '\n' ' ')

Cut video from 00:00:43 sec to 00:00:58 sec (15 sec duration).
Resize it to 720p.
Max quality options, but small size.

MP4

With audio:

@ihorzenich
ihorzenich / Encode mp3.md
Created April 11, 2019 20:48
Encode mp3

Best quality

lame -b 320 --preset insane -q 0 input.wav