Skip to content

Instantly share code, notes, and snippets.

View shibayan's full-sized avatar
🌀
Overworking

Tatsuro Shibamura shibayan

🌀
Overworking
View GitHub Profile
set PATH=%PATH%;D:\7zip
mkdir bin
cd bin
curl -L -O http://dl.bintray.com/oneclick/rubyinstaller/ruby-2.1.3-i386-mingw32.7z
7za x ruby-2.1.3-i386-mingw32.7z
rm -f ruby-2.1.3-i386-mingw32.7z
$.ajax({ type: "POST", url: "/api/settings", data: "{ \"hoge\": \"\1\" }", contentType: "application/json" });
@shibayan
shibayan / Web.config
Created December 29, 2014 13:44
SSL を強制する URL Rewrite 設定
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Force HTTPS" enabled="true">
<match url="(.*)" ignoreCase="false" />
<conditions>
<add input="{HTTPS}" pattern="off" />
</conditions>
@shibayan
shibayan / Program.cs
Created December 30, 2014 08:53
ストレージのパフォーマンスを簡単に調べるやつ
using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
namespace StorageBenchmark
{
class Program
{
static void Main(string[] args)
@shibayan
shibayan / Program.cs
Created December 30, 2014 15:44
今年書いた記事で読まれていないトップ 10 を出す
using System;
using System.Security.Cryptography.X509Certificates;
using Google.Apis.Analytics.v3;
using Google.Apis.Auth.OAuth2;
using Google.Apis.Services;
namespace ConsoleApplication5
{
class Program
@shibayan
shibayan / daruyanagi.txt
Created March 9, 2015 12:10
マルコフ連鎖で作っただるやなぎツイート
うおおお、朝飯買う間もなくいしづち出た
トイレを偵察していて、半世紀が過ぎて、半世紀が過ぎて、ホームページにわしらがなのかな
踏切の非常ボタンが押されたか……今度レシピ調べてみよう
ちょっと……
むりぎぶ。若者っぽい
DaruSIM?
SUZUKIのカテゴリーにこっそりアニメ由来の名前つけるのが一番落ち着く
中核派なんか破防法で潰せばいいんちゃうん(小並感
わしが言われる分には全然気にした科学的回答の一つによれば、このおっさん
まっさかぁ
@shibayan
shibayan / gist:6abf4d5899c26ecbecb0
Last active August 29, 2015 14:17
SHIROBAKO のパクリ
ストーリー:中小SIerの活躍を描くAKAB○U
■舞台
人形町クラウドソリューションっていう架空の会社
■登場人物
・超できるエリートプログラマー「すずきなおき」
・クラウド開発界で No.1 と呼ばれている「ブチゾーカメブチ」
・ちょっと都心から離れたところに住んでる凄腕チューター「ムッシュ小田原」
・No.1 のパトロン「紫の熊の人」
@shibayan
shibayan / script.lua
Last active August 29, 2015 14:23
lua-iis-module
-- クロスドメインなリクエストの時にヘッダを返す Lua
req_headers = iis.req.get_headers()
if req_headers["Origin"] ~= nil then
iis.resp.set_header("Access-Control-Allow-Origin", req_headers["Origin"])
end
var blob = directory.GetBlockBlobReference(filename);
blob.Properties.CacheControl = "public, max-age=31536000";
blob.Properties.ContentType = MimeMapping.GetMimeMapping(filename);
@shibayan
shibayan / gist:74b59cd86d34a56d7fcc
Created September 21, 2015 12:34
jQuery を使わないはてなブログ用タグクラウド表示
<script>
!function () {
var range = 11, base = 90;
var data = [];
var list = document.querySelectorAll(".hatena-module-category ul li a");
for (var i = 0; i < list.length; i++) {
data.push(parseInt(list[i].innerHTML.match(/\((\d+)\)/)[1]));
}
var min = Math.min.apply(null, data), max = Math.max.apply(null, data);
var sqrtMin = Math.sqrt(min), sqrtMax = Math.sqrt(max);