Skip to content

Instantly share code, notes, and snippets.

@youta1119
youta1119 / slack-notify.js
Last active March 6, 2021 10:51
Amplifyのビルドイベントを受け取ってSlackに投げるLambda
const https = require('https');
const URL = require('url').URL;
const AMPLIFY_STAT = {
STARTED: 'STARTED',
SUCCEED: 'SUCCEED',
FAILED: 'FAILED',
UNKNOWN: 'UNKNOWN'
};
const COLOR_PALLET = {
SUCCEED: 'good',
FROM ruby:2.6.0-alpine3.8
ENV LANG C.UTF-8
RUN { \
echo '#!/bin/sh'; \
echo 'set -e'; \
echo; \
echo 'dirname "$(dirname "$(readlink -f "$(which javac || which java)")")"'; \
} > /usr/local/bin/docker-java-home \
OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
OUTPUT_ARCH(i386)
ENTRY(start)
IPLBASE = 0x7c00;
SECTIONS {
        /* ブートローダは0x7c00に読み込まれるため、開始アドレスを0x7c00にする*/
. = IPLBASE;
.text : AT(IPLBASE) {
*(.text)
@youta1119
youta1119 / boot.S
Last active December 13, 2018 15:00
[dont-remove]2018自作OSアドベントカレンダー
# Start the CPU: switch to 32-bit protected mode, jump into C.
# The BIOS loads this code from the first sector of the hard disk into
# memory at physical address 0x7c00 and starts executing in real mode
# with %cs=0 %ip=7c00.
.set PROT_MODE_CSEG, 0x8 # kernel code segment selector
.set PROT_MODE_DSEG, 0x10 # kernel data segment selector
.set CR0_PE_ON, 0x1 # protected mode enable flag
.set STA_X, 0x8 // Executable segment
.set STA_R, 0x2 // Readable (executable segments)
@youta1119
youta1119 / Dockerfile
Last active June 9, 2018 12:41
xv6 build on docker
FROM ubuntu
LABEL maintainer="youta1119 <dev.youta1119@gmail.com>"
LABEL version="1.0"
LABEL description="xv6 compile"
RUN mkdir /root/work
WORKDIR /root/work
RUN apt-get -y update &&\
apt-get -y install curl\
build-essential\
@youta1119
youta1119 / amazon-calc.js
Last active September 18, 2017 08:54 — forked from koyopro/amazon-calc.js
Amazonで一年間に使った金額と、注文履歴のTSVを出力するブックマークレット【2015年版】
// Amazonの注文履歴をTSV形式で出力するスクリプト
//
// 2015-01-01 時点での DOM 構造に対応, GoogleCrome, Opera でテスト済。
// formatEntry関数を書き換えれば自由な書式で出力できます。
//
// 参考:
// - Amazonの注文履歴をCSV形式にして出力するスクリプト
// https://gist.github.com/arcatdmz/8500521
// - Amazon で使った金額の合計を出す奴 (2014 年バージョン)
// https://gist.github.com/polamjag/866a8af775c44b3c1a6d