Skip to content

Instantly share code, notes, and snippets.

View artkirienko's full-sized avatar
🌇
Working remotely @ Vancouver, Canada

Artem Kirienko artkirienko

🌇
Working remotely @ Vancouver, Canada
  • https://pressreader.com
  • Vancouver, Canada
  • 22:43 (UTC -07:00)
  • LinkedIn in/artkirienko
View GitHub Profile
@artkirienko
artkirienko / ROR_interview_questions_middle_2016_Moscow.md
Last active February 3, 2022 19:18
Ruby on Rails interview questions

General: UNIX, HTTP/HTTPS/SSH, API, regex

• В чём разница между процессом и тредом?

• Что такое мультизадачность?

• Устройство файловой системы. Файловые дескрипторы, inode.

• Знаешь ли, что такое race condition? Сталкивался ли в реальной жизни (когда возникало и как боролся)? Когда может произойти?

@artkirienko
artkirienko / encode-mp4.txt
Created December 8, 2017 21:15
ffmpeg video compression / specifc file size
(38.5 MiB * 8192 [converts MiB to kBit]) / 260 seconds = ~1213 kBit/s total bitrate
1213 - 96 kBit/s (desired audio bitrate) = 1117 kBit/s video bitrate
38.5 * 8192.0 / (4 * 60 + 20) - 96 = 1117
ffmpeg -y -i input.mp4 -c:v libx264 -preset medium -movflags faststart -b:v 1117k -pass 1 -an -f mp4 /dev/null && \
ffmpeg -i input.mp4 -c:v libx264 -preset medium -movflags faststart -b:v 1117k -pass 2 -b:a 96k output.mp4
# coderpad test
# https://coderpad.io/
# click Try Sandbox
# choose Ruby
# paste:
# Determine if a word or phrase is an isogram.
# An isogram (also known as a "nonpattern word") is a word or phrase
# without a repeating letter, however spaces and hyphens are allowed
@artkirienko
artkirienko / gist:87ca671de79d0b05eebbf276bc4af9da
Created June 23, 2020 18:14 — forked from ryanlecompte/gist:1420133
Alternative to modifying Proc directly
# alternative to what is explained in the article Ruby Blocks as Dynamic Callbacks:
# http://www.mattsears.com/articles/2011/11/27/ruby-blocks-as-dynamic-callbacks
class Twitter
def tweet(msg, &block)
proxy = DSL[block]
publish(msg)
proxy.respond_with(:success)
rescue => e
proxy.respond_with(:failure, e.message)
# Assume we are in your home directory
cd ~/
# Clone the repo from GitLab using the `--mirror` option
$ git clone --mirror git@your-gitlab-site.com:mario/my-repo.git
# Change into newly created repo directory
$ cd ~/my-repo.git
# Push to GitHub using the `--mirror` option. The `--no-verify` option skips any hooks.
@artkirienko
artkirienko / gist:dd20076b54e003aab3ac17725dacdf54
Created May 6, 2020 15:18 — forked from jwebcat/gist:5122366
Properly download from github using wget and curl
wget --no-check-certificate --content-disposition https://github.com/joyent/node/tarball/v0.7.1
# --no-check-cerftificate was necessary for me to have wget not puke about https
curl -LJO https://github.com/joyent/node/tarball/v0.7.1
@artkirienko
artkirienko / dante_setup.sh
Created May 1, 2020 22:46 — forked from gpchelkin/dante_setup.sh
How To Setup SOCKS5 Proxy Server for (not only) Telegram using Dante on Ubuntu 16.04 / 18.04
### NOT A SCRIPT, JUST A REFERENCE!
# install dante-server
sudo apt update
sudo apt install dante-server
# or download latest dante-server deb for Ubuntu, works for 16.04 and 18.04:
wget http://archive.ubuntu.com/ubuntu/pool/universe/d/dante/dante-server_1.4.2+dfsg-2build1_amd64.deb
# or older version:
wget http://ppa.launchpad.net/dajhorn/dante/ubuntu/pool/main/d/dante/dante-server_1.4.1-1_amd64.deb
@artkirienko
artkirienko / script.sh
Created September 16, 2019 21:12 — forked from cheungnj/script.sh
Convert asciidoc to Github Flavored Markdown
# Adapted from https://tinyapps.org/blog/nix/201701240700_convert_asciidoc_to_markdown.html
# Using asciidoctor 1.5.6.1 and pandoc 2.0.0.1
# Install pandoc and asciidoctor
$ sudo apt install asciidoctor
$ sudo wget https://github.com/jgm/pandoc/releases/download/2.0.0.1/pandoc-2.0.0.1-1-amd64.deb
$ sudo dpkg -i pandoc-2.0.0.1-1-amd64.deb
# Convert asciidoc to docbook using asciidoctor

Keybase proof

I hereby claim:

  • I am artkirienko on github.
  • I am artkirienko (https://keybase.io/artkirienko) on keybase.
  • I have a public key ASDq3RvC1_UrisZ9ycm5ltAuPTQbUkDkRgWc1jwe0lmTJAo

To claim this, I am signing this object:

# frozen_string_literal: true
require 'octokit'
def configure
Octokit.configure do |c|
c.auto_paginate = true
end
end