Skip to content

Instantly share code, notes, and snippets.

View glowacki-dev's full-sized avatar
🐧
🐦

Maciej Głowacki glowacki-dev

🐧
🐦
View GitHub Profile
@glowacki-dev
glowacki-dev / script.sh
Last active July 16, 2021 09:05
Convert transparent webm video to transparent hevc video for safari on macos and ios. According to caniuse.com this gives 95.5% full support for browsers
# Extract video frames, set fps to actual fps of the video
ffmpeg -c:v libvpx-vp9 -i video.webm -vf fps=30 frame-%03d.png
# Merge frames back into movie and encode it to hevc with transparency
ffmpeg -i 'frame-%03d.png' -c:v hevc_videotoolbox -allow_sw 1 -alpha_quality 1 -vtag hvc1 -vf fps=30 hevc.mp4

Keybase proof

I hereby claim:

  • I am glowacki-dev on github.
  • I am bombasarkadian (https://keybase.io/bombasarkadian) on keybase.
  • I have a public key ASCUnp-hwRR0im6dkqxetfUx7IDdN8oFusGwKSI4BUrIbAo

To claim this, I am signing this object:

# frozen_string_literal: true
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
gem "rails", github: "rails/rails"
@glowacki-dev
glowacki-dev / .gitlab-ci.yml
Created March 20, 2018 14:04
Gitlab CI configuration using Container Registry and some awesome base setup
image: registry.your-gitlab-server.com/some-user/some-project:master
variables:
RAILS_ENV: test
POSTGRES_DB: test
POSTGRES_USER: test
POSTGRES_PASSWORD: test-password
before_script:
- bundle install --without development production
@glowacki-dev
glowacki-dev / Dockerfile
Created March 20, 2018 13:38
Basic Dockerfile for GitLab CI
FROM ruby:2.5.0
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
RUN apt-get -qyy install nodejs libpq-dev cmake
COPY Gemfile* /
RUN bundle install --without development production
RUN rm Gemfile*
ENV LANG=C.UTF-8
@glowacki-dev
glowacki-dev / .gitlab-ci.yml
Last active March 20, 2018 14:04
Initial Gitlab CI configuration
image: "ruby:2.4"
cache:
paths:
- vendor/ruby
variables:
RAILS_ENV: test
POSTGRES_DB: test
POSTGRES_USER: test
@glowacki-dev
glowacki-dev / import.rake
Last active October 25, 2017 14:56
Non-ORM import with SQL file access
file = "/tmp/#{SecureRandom.uuid}"
select = <<~MySQL
SELECT id + #{@user_offset}, email, name, created_at, updated_at
FROM users
INTO OUTFILE '#{file}_users'
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n';
MySQL
@glowacki-dev
glowacki-dev / parallel.rb
Created October 10, 2017 07:32
Forking in Ruby
4.times do |i|
fork do
...
end
end
Process.waitall
@glowacki-dev
glowacki-dev / batch_insert.sql
Created October 10, 2017 07:27
Batch insert with Postgres
INSERT INTO `foo` (`bar`, `baz`) VALUES (1, 2), (3, 4), …
@glowacki-dev
glowacki-dev / disable_trigger.sql
Created October 10, 2017 07:26
Disabling database constraints in Postgres
ALTER TABLE comments DISABLE TRIGGER ALL;