Skip to content

Instantly share code, notes, and snippets.

View chaspy's full-sized avatar
💭
🤔

Takeshi Kondo chaspy

💭
🤔
View GitHub Profile
@yuya-takeyama
yuya-takeyama / peco-kubectx
Last active February 28, 2019 13:27
Select Kubernetes context with peco
#!/bin/bash
PECO_CMD="peco"
KUBECTL_CMD="kubectl"
if ! hash "${PECO_CMD}" 2> /dev/null; then
>&2 echo "error: ${PECO_CMD} is not installed"
>&2 echo "see https://github.com/peco/peco"
exit 1
fi
@sj26
sj26 / LICENSE.md
Last active March 8, 2024 18:31
Bash retry function

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit

@kymmt90
kymmt90 / git-reflog.md
Last active December 28, 2022 11:42
`git reflog` についてまとめてみる

git reflog についてまとめてみる

reflog とは

  • reflog(参照ログ)とは HEAD やブランチ先端の動きの履歴
    • 各個人のローカルリポジトリに存在
    • ブランチの切り替え、新たに加えられた変更のプル、履歴の書き換え、あるいは単なる新規コミットの実行などを記録
  • git reflog で HEAD の移動履歴を、git reflog <ブランチ名> でそのブランチ先端が指していたコミットの一覧を確認可能
    • HEAD@{5}: HEAD の五つ前の状態を示す
@miyakogi
miyakogi / config.md
Last active February 8, 2024 08:57
JSON, YAML, ini, TOML ざっくり比較
@konishi
konishi / file0.js
Created November 13, 2012 13:01
URLのタイトルを取得するスクリプト ref: http://qiita.com/items/45c852e2af3d6d8b0736
var checkUrl = "取得したいURL";
function getTitle(url,callback){
var xhr=new XMLHttpRequest()
xhr.onload = function() {
var title=this.responseXML.title||"no title"
callback(url,title)
}
xhr.open("GET", url ,true);
xhr.responseType="document";
@rosylilly
rosylilly / gist:3401612
Created August 20, 2012 06:40
先輩と覚える HTTP ステータスコード

先輩に学ぶ HTTP Status Code

超雑にまとめました。修正してください。

登場人物

  • アプリケーション先輩: いつも忙しい。横に広がるのが得意(デブじゃない)。
  • 後輩: 頼んでばっかしで役に立たない。
  • サーバー先輩: アプリケーション先輩と仲がいい。Unix Socket でつながるくらい仲良し。
  • プロクシ先輩: アプリケーション先輩とかサーバー先輩と後輩の間を取り持って代わりに伝えたりしてくれる。たまに勝手にレスポンスを書き換える。
@taiyoh
taiyoh / nginx.conf
Created October 20, 2011 13:32
nginxを使ったreproxyの最小(に近い)設定
worker_processes 1;
error_log logs/error.log;
daemon off;
events {
worker_connections 1024;
}