Skip to content

Instantly share code, notes, and snippets.

View AlexRogalskiy's full-sized avatar
🛰️
Work on stuff that matters

Alexander AlexRogalskiy

🛰️
Work on stuff that matters
View GitHub Profile
@AlexRogalskiy
AlexRogalskiy / deployment.yaml
Created August 10, 2021 08:28 — forked from robrich/deployment.yaml
Kubernetes first elements
apiVersion: apps/v1
kind: Deployment
metadata:
name: myapp
labels:
app: myapp
spec:
replicas: 3
template:
metadata:
@AlexRogalskiy
AlexRogalskiy / Vagrantfile
Created August 10, 2021 08:29 — forked from robrich/Vagrantfile
MemSQL Vagrant Dev Cluster
Vagrant.configure("2") do |config|
config.vm.box = "generic/ubuntu1904"
# set the provider
config.vm.provider "virtualbox"
# configure the provider
config.vm.provider "virtualbox" do |v|
v.cpus = 4
v.memory = 4096
end
# A deployment ensures pod(s) are restarted on failure
apiVersion: apps/v1
kind: Deployment
metadata:
name: memsql
spec:
replicas: 1 # only create one pod (container)
selector:
matchLabels:
app: memsql
@AlexRogalskiy
AlexRogalskiy / Dockerfile
Created September 13, 2021 02:48 — forked from mikenoethiger/Dockerfile
Dockerfile demonstrating multi-stage build
FROM mysql:5 as sqldump
WORKDIR /home
# Copy required artifacts and source code
COPY initial.sql .
COPY java-program ./java-program
COPY sqldump.sh .
# Copy jdk11 and gradle from the gradle:jdk11 image
COPY --from=gradle:jdk11 /opt/java /opt/java
@AlexRogalskiy
AlexRogalskiy / 2019-https-localhost.md
Created November 1, 2021 11:14 — forked from cecilemuller/2019-https-localhost.md
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

@AlexRogalskiy
AlexRogalskiy / mac-setup-redis.md
Created November 4, 2021 00:42 — forked from tomysmile/mac-setup-redis.md
Brew install Redis on Mac

type below:

brew update
brew install redis

To have launchd start redis now and restart at login:

brew services start redis
@AlexRogalskiy
AlexRogalskiy / create_constraint_if_not_exists.sql
Created November 7, 2021 15:12 — forked from estysdesu/create_constraint_if_not_exists.sql
[PostgreSQL: create constraint if not exists] not sure of sql compatibility with other engines #postgres #constraint #sql
// vim: syntax=sql
CREATE OR REPLACE FUNCTION create_constraint_if_not_exists (t_name text, c_name text, constraint_sql text)
RETURNS void
AS
$BODY$
BEGIN
-- Look for our constraint
IF NOT EXISTS (SELECT constraint_name
FROM information_schema.constraint_column_usage
import scala.annotation.tailrec
object ArraySort extends App {
val array = Array(23, 4325, 4, 11, 34, 324, 65)
def bubbleSort(array: Array[Int]): Array[Int] = {
def swapElements(array: Array[Int]): Int = {
var swapsCount = 0
for (i ← 1 until array.length) {
val leftEl = array(i - 1)
# ./ffmpeg_vp9_2pass.sh input.mp4 2M 96k 1920 60
set -x
input="$1"
bitrate="${2:-2M}"
audio_bitrate="${3:-96k}"
scale="'min(${4:-1920},iw)':'ih*$4/iw'"
fps="${5:-60}"
@AlexRogalskiy
AlexRogalskiy / Symbols.md
Created November 19, 2021 14:06 — forked from reactormonk/Symbols.md
Scalaz Symbol Guide
Symbol Explanation Hint
\/ Right-leaning Either Split ways, go one way or the other
-\/ Left value of \/ - is on the left side
\/- Right value of \/ - is on the right side
>>= flatMap shove result into
>> flatMap(_ => ..) shove into, but ignore the result
|@| Applicatives into Tuple Scream operator
|+| Append via Monoid + was taken
`> ` fa.map(_ => b)