Skip to content

Instantly share code, notes, and snippets.

View mitu217's full-sized avatar
⚙️

mitu217 mitu217

⚙️
View GitHub Profile
@mitu217
mitu217 / main.go
Created March 17, 2019 09:08
カラム番号をスプレッドシートとかのカラム定義に変換するやつ(非推奨。R1C1形式を使うこと)
func columnIndexFromGenericToSpreadsheet(columnIndex int) (string, error) {
return columnIndexFromGenericToSpreadsheetImpl(columnIndex, "ABCDEFGHIJKLMNOPQRSTUVWXYZ")
}
func columnIndexFromGenericToSpreadsheetImpl(columnIndex int, spreadsheetColumnIndexList string) (string, error) {
var (
genericColumnIndex = ""
listLength = len(spreadsheetColumnIndexList)
)
@mitu217
mitu217 / sagas.js
Created February 16, 2017 09:50
React + Redux + Redux-saga
import { takeEvery, delay } from 'redux-saga';
import { put, call } from 'redux-saga/effects';
import { increment } from './actions';
export function* incrementAsync() {
yield call(delay, 1000);
yield put(increment());
}
export default function* rootSaga() {
@mitu217
mitu217 / actions.js
Last active February 16, 2017 09:37
React + Reduxサンプル(動作未検証)
import { createAction } from 'redux-actions';
export const increment = createAction('increment');
@mitu217
mitu217 / CounterActions.js
Created February 15, 2017 17:35
React + Fluxサンプルコード(動かないかも)
'use strict';
const Dispatcher = require('./Dispatcher');
class CounterActions extends Dispatcher.Actions {
submitClicked (text) {
this.emit('submit', text);
}
# 権限のチェック
if (!([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole(`
[Security.Principal.WindowsBuiltInRole] "Administrator")) {
Write-Warning "管理者として実行してください"
exit 1
}
echo "Windowsの開発環境を構築します"
echo ""
private Mesh CreateBlockMesh(GameObject cc, Vector3 centerPos) {
Vector3[] v = new Vector3[4];
/**********
* 表面
* ********/
int[] use_vertices1 = new int[4];
v[0] = centerPos + Vector3.up * 0.5f + Vector3.right * 0.5f;
v[1] = centerPos + Vector3.up * 0.5f + Vector3.left * 0.5f;
v[2] = centerPos + Vector3.down * 0.5f + Vector3.left * 0.5f;
function onSubmitForm(e){
var res = e.response;
var FORM_DATA = res.getItemResponses();
var item = FORM_DATA[0].getResponse(); // 支出項目
var summary = FORM_DATA[1].getResponse() // 支出概要
var money = FORM_DATA[2].getResponse(); // 支出金額
def insert_message
img_file = "描画対象のファイルパス"
FileUtils.cp(img_file, img_file + ".org", {:preserve => true}) # 元画像退避
img = Magick::ImageList.new(img_file) # 画像オブジェクト
draw = Magick::Draw.new # 描画オブジェクト
begin
draw.annotate(img, 0, 0, 0, -175, message) do
self.font = 'やさしさゴシックのファイルパス' # フォント
self.fill = 'black' # 文字色
@mitu217
mitu217 / GenerateMesh.cs
Last active June 29, 2017 15:28
PolyMesh
using UnityEngine;
using System.Collections.Generic;
[ExecuteInEditMode]
[RequireComponent(typeof(MeshRenderer))]
[RequireComponent(typeof(MeshFilter))]
public class GenerateMesh : MonoBehaviour
{
/// <summary>
/// パス座標
@mitu217
mitu217 / SingletonMonoBehaviour.cs
Created June 25, 2015 16:38
SingletonClass for Unity
using UnityEngine;
public class SingletonMonoBehaviour<T> : MonoBehaviour where T : SingletonMonoBehaviour<T>
{
protected static T instance;
/// <summary>
/// インスタンスの取得
/// </summary>
public static T Instance {