Skip to content

Instantly share code, notes, and snippets.

View maslick's full-sized avatar
🙃
AWS, MLOps, Airflow/MWAA, dbt

Paul Maslov maslick

🙃
AWS, MLOps, Airflow/MWAA, dbt
View GitHub Profile
@maslick
maslick / fixIOSAudioContext.js
Created January 12, 2022 10:22 — forked from kus/fixIOSAudioContext.js
Fix iOS AudioContext on Safari not playing any audio. It needs to be "warmed up" from a user interaction, then you can play audio with it as normal throughout the rest of the life cycle of the page.
// Fix iOS Audio Context by Blake Kus https://gist.github.com/kus/3f01d60569eeadefe3a1
// MIT license
(function() {
window.AudioContext = window.AudioContext || window.webkitAudioContext;
if (window.AudioContext) {
window.audioContext = new window.AudioContext();
}
var fixAudioContext = function (e) {
if (window.audioContext) {
// Create empty buffer
1. Create 2 VMs on AWS
export MY_ACCESS_KEY_ID=….
export MY_SECRET_ACCESS_KEY=……
docker-machine create --driver amazonec2 \
--amazonec2-access-key $MY_ACCESS_KEY_ID \
--amazonec2-secret-key $MY_SECRET_ACCESS_KEY \
--amazonec2-region eu-central-1 \
--amazonec2-instance-type m5.large \
k8s-master
@maslick
maslick / busybox.yaml
Created April 28, 2019 12:23
busybox k8s pod
apiVersion: v1
kind: Pod
metadata:
name: busybox
labels:
app: busybox
spec:
containers:
- name: busybox
image: busybox
@maslick
maslick / CleanNetty.java
Created March 31, 2019 16:09
raw Netty
import org.springframework.http.MediaType;
import org.springframework.http.server.reactive.HttpHandler;
import org.springframework.http.server.reactive.ReactorHttpHandlerAdapter;
import org.springframework.web.reactive.function.server.RouterFunction;
import org.springframework.web.reactive.function.server.RouterFunctions;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;
import reactor.netty.DisposableServer;
import reactor.netty.http.server.HttpServer;
// create new app
rails new haha-app
// create db
rake db:create
// create chapter
rails g scaffold Chapter title:string content:text
// migrate changes
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.CommandLineRunner
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.builder.SpringApplicationBuilder
import org.springframework.context.support.beans
import org.springframework.stereotype.Component
interface Yoyo {
fun haha() {
println("hello world")
package com.maslick.threading;
import com.google.common.util.concurrent.CycleDetectingLockFactory;
import com.google.common.util.concurrent.ListeningExecutorService;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.common.util.concurrent.Uninterruptibles;
import javax.annotation.Nullable;
import java.util.concurrent.*;
import java.util.concurrent.locks.ReentrantLock;
@maslick
maslick / index.html
Last active February 16, 2017 07:36
Pingo-pongo
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Pingo-pongo</title>
<link rel="stylesheet" href="https://www.amcharts.com/lib/3/plugins/export/export.css" type="text/css" media="all" />
<link rel="stylesheet" href="style.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"></script>
<script src="https://www.amcharts.com/lib/3/amcharts.js"></script>
# MQTT broker
docker pull toke/mosquitto
docker run -d -p 1883:1883 -p 9001:9001 toke/mosquitto
# AMQP broker
docker pull mesasadc/rabbitmq-webstomp
docker run -d -p 15674:15674 -p 61613:61613 -p 15672:15672 -p 5672:5672 -h my-rabbit2 --name=myrabbit mesasadc/rabbitmq-webstomp:latest
@maslick
maslick / gist:7e58d606943a1244a6b2c78289fe2b63
Created January 10, 2017 23:06 — forked from bleathem/gist:50b4dd2fd4377503eaad
Creating an Rx.js Observable from a STOMP over Websocket source (with error handling)
// see: https://github.com/jmesnil/stomp-websocket
var client = Stomp.client('ws://...');
client.debug = undefined;
var live = Rx.Observable.create(function (observer) {
console.log('Connecting...')
client.connect(username, password, function(frame) {
console.log(frame.toString());
observer.onNext(frame);