Skip to content

Instantly share code, notes, and snippets.

View antonkomarev's full-sized avatar
🇦🇶
Antarctic Bear

Anton Komarev antonkomarev

🇦🇶
Antarctic Bear
View GitHub Profile
@antonkomarev
antonkomarev / php.Dockerfile
Created July 19, 2024 08:24
How to install PHP in Docker when "add-apt-repository -y ppa:ondrej/php" is not available
apt-get -y install --no-install-recommends --no-install-suggests dirmngr && \
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 71DAEAAB4AD4CAB6 4F4EA0AAE5267A6C && \
add-apt-repository -y "deb https://mirror.yandex.ru/mirrors/launchpad/ondrej/php/ $(lsb_release -cs) main"
@antonkomarev
antonkomarev / .bash_profile
Last active March 8, 2022 20:48
Restart docker on MacOS, quick git commands
# vi ~/.bash_profile
# Docker
d () {
if [ -f $1 ] ; then
echo "Available commands:"
echo " \e[32md restart\e[0m - Restart docker service"
echo " \e[32md stop\e[0m - Stop all docker containers"
return 0
@antonkomarev
antonkomarev / git-io-custom-url.md
Created September 15, 2020 08:50 — forked from dikiaap/git-io-custom-url.md
git.io custom URL

Command:

curl https://git.io/ -i -F "url=https://github.com/YOUR_GITHUB_URL" -F "code=YOUR_CUSTOM_NAME"

URLs that can be created is from:

  • https://github.com/*
  • https://*.github.com
  • https://*.github.com/*
  • https://*.github.io
@antonkomarev
antonkomarev / .gitconfig
Last active September 13, 2021 21:09
Useful git aliases to speed up development
[alias]
cleanup = "!git fetch -p && git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -D"
go = "!git switch ${1:-master} && git pull && git cleanup"
@antonkomarev
antonkomarev / plink-plonk.js
Created February 15, 2020 19:33 — forked from tomhicks/plink-plonk.js
Listen to your web pages
@antonkomarev
antonkomarev / .gitconfig
Last active June 20, 2020 20:52
Git configuration
[core]
excludesfile = ~/.gitignore
[alias]
current-hash = "rev-parse HEAD"
current-branch = "rev-parse --abbrev-ref HEAD"
clean-up = "!git fetch -p && git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -D"
go = "!git checkout ${1:-master} && git pull && git clean-up"
alias art='php artisan'
alias pu='vendor/bin/phpunit'
alias puf='vendor/bin/phpunit --filter='
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
@antonkomarev
antonkomarev / ffmpeg-html5
Created December 12, 2017 15:25 — forked from yellowled/ffmpeg-html5
Convert videos to proper formats for HTML5 video on Linux shell using ffmpeg. Will probably convert this to a bash script later, but for the time being, here's some examples. Not sure there have actually sensible dimensions and bitrates for web video.
# webm
ffmpeg -i IN -f webm -vcodec libvpx -acodec libvorbis -ab 128000 -crf 22 -s 640x360 OUT.webm
# mp4
ffmpeg -i IN -acodec aac -strict experimental -ac 2 -ab 128k -vcodec libx264 -vpre slow -f mp4 -crf 22 -s 640x360 OUT.mp4
# ogg (if you want to support older Firefox)
ffmpeg2theora IN -o OUT.ogv -x 640 -y 360 --videoquality 5 --audioquality 0 --frontend

Real-time Grid Component with Laravel, Vue.js, Vuex & Socket.io (Google Docs-like Functionality)

Motivation

The exercise of writing this tutorial -- as well as recording it as a screencast -- has helped me better understand the concepts behind a couple of my favorite open source tools. Both the tutorial and screencast will be of personal use in the future as references. If they are of help to others, that will be great too.

I love Google Docs' real-time, multi-user interactive capability, and I've have always been a fan of spreadsheets. I wanted to see if I could replicate that type of functionality. What I've done is taken the basic Vue.js Grid Component example and altered it a bit so that when a user clicks on a cell, that cell becomes highlighted or "active", not just in the user's browser but in any browser instance cur

# Example integration of a background-image uploader
# Author: Guillaume Piot
# Email: [email protected]
# Company: Cotidia Ltd
# Licence: MIT
#
# The div holder is absolute positioned within the parent div
#
# <div class="[ article__image ] [ article-image ] [ editable ] [ parallax ]" data-name="article_image">
# <div