Skip to content

Instantly share code, notes, and snippets.

View TatsuyaOGth's full-sized avatar

Tatsuya Ogusu TatsuyaOGth

View GitHub Profile
@TatsuyaOGth
TatsuyaOGth / common.h
Created June 18, 2014 13:19
Detect reliably Mac OS X, iOS, Linux, Windows in C preprocessor
#ifdef _WIN64
//define something for Windows (64-bit)
#elif _WIN32
//define something for Windows (32-bit)
#elif __APPLE__
#include "TargetConditionals.h"
#if TARGET_OS_IPHONE && TARGET_IPHONE_SIMULATOR
// define something for simulator
#elif TARGET_OS_IPHONE
// define something for iphone
@TatsuyaOGth
TatsuyaOGth / file0.html
Last active August 29, 2015 14:11
Proessing.js でJavaScript側からProcessingの任意の関数を呼ぶ or 値を渡す方法 ref: http://qiita.com/TatsuyaOGth/items/fc80020a285e62335a4a
<!DOCTYPE html>
<html>
<head>
<title>Hello Web - Controlling Processing from JavaScript</title>
<script src="processing-1.3.6.min.js"></script>
</head>
<body>
<!-- ここまでは必須項目
Processingアプリケーションのjavascriptモードでも自動的にエクスポートされます -->
@TatsuyaOGth
TatsuyaOGth / auto_screen_logger.py
Created January 2, 2015 19:28
Automatic Screen Logger Python code for Mac OSX
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import time
import subprocess
from datetime import datetime
argv = sys.argv
if len(argv) > 1:
@TatsuyaOGth
TatsuyaOGth / .vimrc
Created January 6, 2015 16:25
my vimrc
" reference: http://d.hatena.ne.jp/mtbtaizo/20080622
"# set nocompatible "vi非互換モード
"#######################
" 表示系
"#######################
set number "行番号表示
set showmode "モード表示
set title "編集中のファイル名を表示
set ruler "ルーラーの表示
@TatsuyaOGth
TatsuyaOGth / particle_with_pointsprite_example.cpp
Last active August 29, 2015 14:20
An openFrameworks example of particle generation with point sprite.
#include "ofMain.h"
#include "ofxAnimationPrimitives.h"
static const string SHADER_FILEPATH_VERT = "shaders/pointSprite.vert";
static const string SHADER_FILEPATH_FRAG = "shaders/pointSprite.frag";
static const string TEXTURE_FILE_DIR = "textures";
class Particle : public ofxAnimationPrimitives::Instance
{
const int mNum;
@TatsuyaOGth
TatsuyaOGth / utils.h
Created November 4, 2015 12:31
common utility file for my openFrameworks project
#pragma once
#include "ofMain.h"
/**
* Logger util
*/
#define __FILE_AND_LINE__ ofSplitString(ofToString(__FILE__), "/").back()+"|line:"+ofToString(__LINE__)
#define LOG_NOTICE ofLogNotice(__FILE_AND_LINE__)
#define LOG_WARNING ofLogWarning(__FILE_AND_LINE__)
@TatsuyaOGth
TatsuyaOGth / file0.txt
Last active May 9, 2017 10:07
【C++】画像の細線化処理(Hilditchの方法) ref: http://qiita.com/TatsuyaOGth/items/45965e1632f41f3eb139
N_8 = \left\{ P_1, P_2, P_3, P_4, P_5, P_6, P_7, P_8 \right\}
@TatsuyaOGth
TatsuyaOGth / file0.txt
Last active September 15, 2016 12:41
【C++】細線化した画像のセグメント分割 ref: http://qiita.com/TatsuyaOGth/items/292317e9f5a5256098e7
P_{i, j} = (p_0, p_1, ... p_{j-1} ) \\
p_j = (x, y)
public static T DeepCopy<T>(T src)
{
using (var stream = new MemoryStream())
{
var serializer = new XmlSerializer(typeof(T));
serializer.Serialize(stream, src);
stream.Seek(0, SeekOrigin.Begin);
return (T)serializer.Deserialize(stream);
}
}
@TatsuyaOGth
TatsuyaOGth / rsync_config.txt
Last active September 17, 2021 12:53
rsync_commands
# ローカルフォルダ
local="rsync_test_dir"
# リモートフォルダ
remote="rsync://[email protected]/public/rsync"
# ローカルのバックアップ保存先
local_backup="./_deleted_files/$(date +%Y-%m-%d_%H-%M-%S)"
# リモートのバックアップの保存先