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
; NASM x86 | |
global _start | |
_start: | |
mov eax, 2 | |
mov edx, 1 | |
add edx, eax ; 3 | |
add edx, '0' ; '3' | |
mov [sum], edx |
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
FROM golang:latest as builder | |
WORKDIR /opt/server | |
COPY . . | |
RUN CGO_ENABLED=0 GOOS=linux go build -o app main.go | |
FROM alpine:latest | |
EXPOSE 8080 | |
COPY --from=builder /opt/server/app /opt/server/app | |
CMD ["/opt/server/app"] |
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
#!/usr/bin/env ruby | |
COMPACTION = !!ENV['COMPACTION'] | |
def gc | |
GC.start | |
sleep 1 | |
GC.compact if COMPACTION | |
sleep 1 if COMPACTION | |
end |
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
version: "3" | |
services: | |
traefik: | |
image: "traefik:v2.2" | |
ports: | |
- "80:80" | |
- "8080:8080" | |
volumes: | |
- "/var/run/docker.sock:/var/run/docker.sock:ro" |
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
var AWS = require('aws-sdk'); | |
var cloudwatch = new AWS.CloudWatch(); | |
exports.handler = function (event, context) { | |
alarmMetricStatistics("http", event, context); | |
alarmMetricStatistics("app", event, context); | |
} | |
function alarmMetricStatistics(namespace, event, context) { | |
console.log(`check namespace: ${namespace}`); |
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
# Server Sent Events (SSE) Windows Client sample | |
# (but cannot install/load em-eventsource) | |
require 'win32ole' | |
require 'em-eventsource' | |
# Windows Script Host :( | |
shell = WIN32OLE.new('Shell.Application') | |
wsh = WIN32OLE.new('Wscript.Shell') |
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
# Server Sent Events (SSE) Server sample | |
# refs. https://gist.github.com/rkh/1476463 | |
require 'sinatra' | |
require 'thin' | |
set :bind, '0.0.0.0' | |
set :port, 8080 | |
connections = [] |