Skip to content

Instantly share code, notes, and snippets.

View ysugimoto's full-sized avatar
🕘
GMT+9 JST

Yoshiaki Sugimoto ysugimoto

🕘
GMT+9 JST
View GitHub Profile
@ysugimoto
ysugimoto / statics.js
Created October 6, 2022 13:25
next-compute-js generates statics files :)
import { Buffer } from "buffer";
import file0 from "../../.next/BUILD_ID?staticBinary";
import file1 from "../../.next/build-manifest.json?staticText";
import file2 from "../../.next/export-marker.json?staticText";
import file3 from "../../.next/images-manifest.json?staticText";
import file4 from "../../.next/next-server.js.nft.json?staticText";
import file5 from "../../.next/package.json?staticText";
import file6 from "../../.next/prerender-manifest.json?staticText";
import file7 from "../../.next/react-loadable-manifest.json?staticText";
import file8 from "../../.next/required-server-files.json?staticText";
@ysugimoto
ysugimoto / check-replaced-package.bash
Created September 14, 2020 05:58
Ensure you are not using replaced package in go.mod.
#!/bin/bash
findup () {
CWD=$1
while [ "$CWD" != "/" ]; do
if [ -f "$CWD/go.mod" ]; then
echo "$CWD/go.mod"
return 0
fi
CWD=$(dirname $CWD)
@ysugimoto
ysugimoto / Dockerfile
Created April 3, 2020 09:00
Install OpenResty with Opentracing
# Dockerfile - Ubuntu Xenial
# https://github.com/openresty/docker-openresty
ARG RESTY_IMAGE_BASE="ubuntu"
ARG RESTY_IMAGE_TAG="xenial"
FROM ${RESTY_IMAGE_BASE}:${RESTY_IMAGE_TAG}
LABEL maintainer="Evan Wies <evan@neomantra.net>"
----------------------------------------------------------------
-- Lua common HTTP request library
--
-- This library is utility for common HTTP/HTTPS request usage,
-- and provide easy syntax like python requests module.
--
-- Dependencies
-- - [luasocket](https://github.com/diegonehab/luasocket)
-- - [luasec](https://github.com/brunoos/luasec)
-- - [net-url](https://github.com/golgote/neturl)
@ysugimoto
ysugimoto / get_credential.go
Created October 4, 2018 02:25
Get IAM profile credentials for golang
package main
import (
"bufio"
"context"
"errors"
"fmt"
"time"
"encoding/json"
@ysugimoto
ysugimoto / example.go
Created August 18, 2018 13:25
list imports example
package main
import (
"fmt"
"github.com/satori/go.uuid"
"github.com/stretch/testify/assert"
)
func main() {
@ysugimoto
ysugimoto / client.go
Created August 15, 2018 07:14
socket multiplexer example
package main
import (
"bufio"
"fmt"
"log"
"net"
"strings"
"sync"
"time"
@ysugimoto
ysugimoto / detect_nullbyte.go
Last active August 2, 2018 08:45
Detect surrogate pair on Golang
package main
import (
"fmt"
)
func detect_nullbyte(str string) bool {
for _, b := range str {
if b == '\u0000' {
return true
@ysugimoto
ysugimoto / github-release.sh
Last active March 10, 2018 05:51
Release tag version with some artifacts
#!/bin/sh
### Github create release script
### This script requires following UNIX commands:
### - jq
### - file
### - curl
### - basename
### Those commands might not be installed on CI environment due to tiny OS package,
### So probably you need to install manually.
@ysugimoto
ysugimoto / fumake
Last active February 3, 2018 06:02
Find up `Makefile` and run it
#!/bin/sh
MPATH=$PWD
MAKECOMMAND=$(which make)
if [ "${MAKECOMMAND}" = "" ]; then
echo "make command could't find in your \$PATH. Did you install it?"
exit 1
fi