Skip to content

Instantly share code, notes, and snippets.

View naokirin's full-sized avatar

naokirin(Naoki Hayashida) naokirin

View GitHub Profile
@naokirin
naokirin / git-now
Created June 21, 2013 11:14
git-now + adding only specific file (--managed)
#!/bin/sh
PREFIX="from now"
MESSAGE="[${PREFIX}] `date +\"%Y/%m/%d %T\"`"
get_amend() {
if [ -z `git log --pretty=oneline -1 | cut -d " " -f 2- | grep "^\[${PREFIX}]"` ]
then
return 1
fi
NeoBundle 'rhysd/vim-clang-format'
NeoBundle 'Shougo/vimproc'
NeoBundle 'itchyny/lightline.vim'
NeoBundle "thinca/vim-quickrun"
NeoBundle "osyo-manga/shabadou.vim"
NeoBundle "osyo-manga/vim-watchdogs"
NeoBundle "jceb/vim-hier"
NeoBundle "yonchu/quickfixstatus"
" :WatchdogsRun後にlightline.vimを更新
@naokirin
naokirin / gist:71a77e9770458a04b88f
Last active August 29, 2015 14:16
fugitive (git grep) + unite-quickfix
NeoBundle "osyo-manga/unite-quickfix.git"
" ------ unite-quickfix ------
command UniteQuickFix Unite -no-quit -vertical -winwidth=40 -max-multi-lines=1 quickfix
function! s:open_quickfix_with_ggrep(...)
let _ = join(a:000, " ")
execute ":Ggrep "._ | redraw!
if (len(getqflist()) > 0)
execute ":UniteQuickFix"
endif
au BufNewFile,BufRead *.rb,*.haml,*.erb,*.slim set nowrap tabstop=2 shiftwidth=2
au BufNewFile,BufRead *.cpp,*.h,*.hpp,*.cc set nowrap tabstop=4 shiftwidth=4
@naokirin
naokirin / GizmosMeshNormalDrawer.cs
Last active May 23, 2016 02:33
UnityのSceneビューでメッシュの法線を表示する
using UnityEngine;
using System.Linq;
public static class GizmosArrowDrawer
{
public static void Draw(Vector3 pos, Vector3 direction, float arrowHeadLength = 0.25f, float arrowHeadAngle = 20.0f)
{
Gizmos.DrawRay(pos, direction);
Vector3 right = Quaternion.LookRotation(direction) * Quaternion.Euler(0, 180 + arrowHeadAngle, 0) * new Vector3(0, 0, 1);
using UnityEngine;
using UnityEditor;
[CustomEditor(typeof(MeshFilter))]
public class MeshInformation : Editor
{
public override void OnInspectorGUI()
{
var filter = target as MeshFilter;
string message = "Triangles: " + filter.sharedMesh.triangles.Length / 3 + " Vertices: " + filter.sharedMesh.vertices.Length;
#!/usr/bin/python -u
import sys
import os
import getopt
from supervisor import childutils
from datetime import datetime
class ProcessStateNotifier:
@naokirin
naokirin / 0_reuse_code.js
Created June 10, 2017 09:39
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@naokirin
naokirin / Dockerコンテナ上のログ集約に関するまとめ.md
Last active August 5, 2023 18:41
Dockerコンテナ上のログ集約に関するまとめ

検討するための情報

Dockerコンテナ上のログを集約する方法

  • コンテナの内部で集約する
    • e.g. fluentd、rsyslog等を各コンテナ内に立てる
    • e.g. 単純にファイルに保存する
  • コンテナの外部で集約する
    • e.g. ホスト側にfluentd、rsyslog等を起動して、各コンテナがマウントしたログファイルをtail等で読む
  • e.g. ホスト側にマウントしてファイルに保存する
@naokirin
naokirin / kubernetes.md
Last active November 27, 2018 13:18
k8sの調査リスト