Skip to content

Instantly share code, notes, and snippets.

View danimal141's full-sized avatar
💁‍♂️
Get wild and tough

Hideaki ishii danimal141

💁‍♂️
Get wild and tough
  • Tokyo, Japan
View GitHub Profile
$! raise された例外オブジェクト
$" require で読み込まれたファイルの配列
$#
$$ 現在のプロセス ID
$%
$& 正規表現にマッチした箇所の文字列
$' 正規表現にマッチした箇所より後ろの文字列
$(
$)
$* Ruby スクリプトに指定された引数。ARGV と同じ
@danimal141
danimal141 / TypeErasure.swift
Last active March 9, 2017 09:47 — forked from gwengrid/TypeErasure.swift
Example of type erasure with Pokemon
class Thunder { }
class Fire { }
protocol Pokemon {
typealias PokemonType
func attack(move: PokemonType)
}
struct Pikachu: Pokemon {
typealias PokemonType = Thunder
@danimal141
danimal141 / amz_content_sha256.js
Created January 19, 2025 05:49 — forked from antonbabenko/amz_content_sha256.js
Lambda@Edge (origin-request) for CloudFront OAC with Lambda Function URL integration for POST/PUT
'use strict';
const crypto = require('crypto');
exports.handler = (event, context, callback) => {
const request = event.Records[0].cf.request;
const headers = request.headers;
const method = request.method;
const body = Buffer.from(request.body.data, 'base64').toString();