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:1.20-alpine as builder | |
RUN apk update && apk add --repository http://dl-cdn.alpinelinux.org/alpine/v3.4/main --no-cache ca-certificates gcc libc-dev | |
WORKDIR /app | |
COPY go.* ./ | |
RUN go mod download | |
COPY run/ ./run |
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
<div data-controller="clipboard"> | |
<button data-action="click->clipboard#copy" type="button" data-clipboard-target="value" data-copy="some copy text"></button> | |
<div data-clipboard-target="tooltip" role="tooltip" class="absolute z-10 invisible inline-block px-3 py-2 text-sm font-medium text-white transition-opacity duration-300 bg-gray-900 rounded-lg shadow-sm opacity-0 tooltip dark:bg-gray-700"> | |
Copied! | |
<div class="tooltip-arrow" data-popper-arrow></div> | |
</div> | |
</div> |
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
PROJECT_ID="some-project-id" | |
ENV="dev" | |
TARGETS=$(shell grep -E '^deploy-function[a-zA-Z_-]+:' $(MAKEFILE_LIST) | cut -d : -f 1) | |
deploy-all: $(TARGETS) | |
deploy-function_some: | |
gcloud --project $(PROJECT_ID) functions deploy --region asia-northeast1 SomeFunction \ | |
--set-env-vars PROJECT_ID=$(PROJECT_ID),RUNTIME_ENVIRONMENT=$(ENV) \ | |
--runtime go111 \ |
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
'use strict'; | |
const now = new Date(); | |
const addDays = function(date, days) { | |
const d = new Date(date); | |
d.setDate(d.getDate() + days); | |
return d; | |
}; | |
const toYMD = function(date) { |
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
(function(){ | |
"use strict"; | |
const template = '<span class="fontsize-m" style="margin-right: 6px;"><a href="https://stocks.finance.yahoo.co.jp/stocks/detail/?code={{ .stock.Code }}.T" class="underline">{{ .stock.Code }}(JQ)</a></span>{{ .stock.Close | Commify }}円 <br class="show_sp"><small class="fontsize-m">前日比:{{ .stock.Diff | Commify }}円 出来高:{{ .stock.Volume | Commify }}株</small>'; | |
const script = document.createElement('script'); | |
script.src = 'https://denkei-agh-tools-prod.an.r.appspot.com/?callback=stockWidgetCallback&symbol=1783.T'; | |
const parent = document.getElementsByTagName('script')[0]; | |
parent.parentNode.insertBefore(script, parent); | |
window.stockWidgetCallback = (res) => { | |
console.log(res); | |
const inner = document.getElementById('widget-inner'); |
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 main | |
import ( | |
"io" | |
"net/http" | |
"strings" | |
) | |
func main() { | |
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { |
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 main | |
import ( | |
"fmt" | |
"image" | |
"image/jpeg" | |
"io/ioutil" | |
"os" | |
"path" | |
"path/filepath" |
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 main | |
import ( | |
"fmt" | |
"io" | |
"net/http" | |
) | |
func main() { | |
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { |
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
<script type="text/javascript"> | |
if (location.protocol != 'https:') { | |
location.href = 'https:' + location.href.substring(location.protocol.length); | |
} | |
</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
plackup -MData::Dumper -e 'sub { [200, [], [Dumper(\@_)]] }' |
NewerOlder