This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: busybox | |
labels: | |
app: busybox | |
spec: | |
containers: | |
- name: busybox | |
image: busybox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// create new app | |
rails new haha-app | |
// create db | |
rake db:create | |
// create chapter | |
rails g scaffold Chapter title:string content:text | |
// migrate changes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); |
NewerOlder