Skip to content

Instantly share code, notes, and snippets.

@meganehouser
meganehouser / process3dGraph.py
Created February 6, 2012 13:24
This is a script which draws the amount of CPU used and memory usage of a process to a 3D graph.
#coding:utf-8
import psutil
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
TIME_NUM = 90
FRAMES = 360
@meganehouser
meganehouser / Game.cs
Created October 13, 2012 15:27
C# CodeKata (Bowlling Game Kata)
using System.Collections.Generic;
using System.Linq;
namespace BowllingGamaKata
{
public class Game
{
private List<int> rolls;
public Game()
@meganehouser
meganehouser / gist:3885030
Created October 13, 2012 15:35
特定の拡張子のファイルに更新があった場合にビルド要求を投げるHook
# coding: utf-8
from mercurial import ui, hg
# 更新があったときにビルド要求をする拡張し
EXTENSION = '.rst'
# ビルド用URL
BUILD_URL = 'http://example.jp:8080/job/job_name/build'
@meganehouser
meganehouser / post-commit.py
Created December 13, 2012 04:49
SubversionのコミットをIPメッセンジャーで通知する(Windows)
#!python 2
#! coding:utf-8
"""
リポジトリのhooksフォルダに置く。
hooksフォルダのpost-commit.batには以下のように記述。
cd C:\Repositorys\exampleProject\hooks
post-commit.py %1 %2
"""
@meganehouser
meganehouser / EmptyGame.fs
Last active December 18, 2015 23:19
Delta Engine の Sample/Empty Game を F# に移植
open DeltaEngine.Core
open DeltaEngine.Datatypes
open DeltaEngine.Platforms
type EmptyGame() =
let mutable fadePercentage = 0.0f
let mutable currentColor = Color.Black
let mutable nextColor = Color.Black
let SwitchNextRandomColor() =
@meganehouser
meganehouser / EmptyGame.fs
Last active December 19, 2015 00:28
Delta Engine の Sample/EmptyGame を F# で無理やり mutable をなくして実装。
open DeltaEngine.Core
open DeltaEngine.Datatypes
open DeltaEngine.Platforms
type LerpColor = { Current: Color; Next: Color; Percentage:float32 }
[<CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>]
module LerpColor =
let initialState = {Current=Color.Black; Next=Color.Black; Percentage=0.0f}
@meganehouser
meganehouser / gist:6397574
Last active December 7, 2018 00:48
談話室のGo言語導入資料的なあれ。
@meganehouser
meganehouser / scopedregistry.py
Last active December 26, 2015 12:49
Pythonのレジストリパターン実装
class Registry(object):
instance = None
@classmethod
def initialize(cls):
cls.instance = Registry()
def __init__(self):
self.data = 'Hello World'
@meganehouser
meganehouser / ci.bat
Created October 29, 2013 07:58
WindowsでWatchDogを使って、.csファイルを監視。 C#プロジェクトの自動ビルド、ユニットテストを行う。
set nunit_dir=(NUnitのインストールフォルダ)
set msbuild_dir=c:\Windows\Microsoft.NET\Framework\v4.0.30319
set target=(csprojのパス)
set testdll=(テストプロジェクトのDLLのパス)
watchmedo shell-command --patterns="*.cs" --recursive --wait --command="%msbuild_dir%\MSBuild.exe %target% & %nunit_dir%\nunit-console.exe %testdll% /nologo"
@meganehouser
meganehouser / CopyZip.ps1
Created January 25, 2014 17:07
頼まれたやつ
### 使い方
### 1. PowerShellを起動する
### 2. PowerShell 実行権限の変更(最初の一回のみ実行)
### Set-ExecutionPolicy RemoteSigned
### 3. 7z をインストール(インストールしたフォルダ内に7z.exeがある)
### http://sevenzip.sourceforge.jp/download.html
### 4. このスクリプトをCopyZip.ps1というファイル名で実行
### 5. コピー元のフォルダパス、コピー先・ZIPファイル作成先のフォルダパス、7z.exeのパスを書き換える
### 6. PowerShellでカレントディレクトリをCopyZip.ps1を置いたディレクトリに移動
### 7. 以下のコマンドを実行