Skip to content

Instantly share code, notes, and snippets.

View vanx2's full-sized avatar

Shigeto Yatani (for work) vanx2

  • IDC Frontier
  • Japan
View GitHub Profile
@vanx2
vanx2 / gist:4316559
Created December 17, 2012 08:05
escape test
<html>
<body>
<form name=a>
<input type=text name=x value="te\st">
<input type=button onClick="alert(document.a.x.value);">
<hr>
<div id="y">te\st</div>
<input type=button onClick="alert(document.getElementById('y').innerHTML);">
<hr>
<input type=button onClick="alert('te\st');">
@vanx2
vanx2 / gist:6840134d9ca970140bfd
Created June 19, 2015 10:04
勉強会チェックリスト

案内事項

  • タイトル
  • 内容
  • 日付
  • 場所

直前

  • 注文 -- ピザ
@vanx2
vanx2 / integration_testing.md
Last active December 16, 2016 01:47
integration testing for Mitaka

items

  • create
  • read
  • destroy
  • change_flavour
  • expand_volume
  • stop
  • start
  • suspend
  • resume
@vanx2
vanx2 / generate token by sha256
Last active March 11, 2022 06:42
Generate token for Fastly - PHP
<?php
$key = base64_decode("iqFPeN2u+Z0Lm5IrsKaOFKRqEU5Gw8ePtaEkHZWuD24="); # 発行したシークレットキーをセット
$token_lifetime = 3600; # 有効期限を1時間とする
$path = "/foo/bar.html"; # アクセス先のパス情報
$expiration = time() + $token_lifetime; # 有効期限の unix time 取得
$string_to_sign = $path . $expiration; # パスと有効期限を連結してメッセージを作成