Skip to content

Instantly share code, notes, and snippets.

View HiromichiYamada's full-sized avatar

Hiromichi Yamada HiromichiYamada

View GitHub Profile
@GOROman
GOROman / WebCam.cs
Last active July 3, 2021 01:22
UnityでWeb Cameraをテクスチャにアサインし、そのテクスチャをPNGでセーブする例
using UnityEngine;
using System.Collections;
using System.IO;
public class WebCam : MonoBehaviour {
public int Width = 1280;
public int Height = 720;
public int FPS = 15;
public Material material;
@MakoTano
MakoTano / config.php
Last active August 29, 2015 14:03
sample config about cakephp deployment using altax. (But I use it in real)
<?php
// Altax - http://kohkimakimoto.github.io/altax/
// Autoloading for plugin command classes.
if (is_file(__DIR__ . '/vendor/autoload.php')) require_once __DIR__ . '/vendor/autoload.php';
// ***************************************************************
// Server definition. - change here.
// ***************************************************************
Server::nodesFromSSHConfigHosts();
@jiro
jiro / gist:5989320
Created July 13, 2013 03:41
iOctocatから学ぶiOSアプリ開発手法 (発表メモ)
@MrRooni
MrRooni / gist:4988922
Created February 19, 2013 19:16
UITableView and NSFetchedResultsController: Updates Done Right
@interface SomeViewController ()
// Declare some collection properties to hold the various updates we might get from the NSFetchedResultsControllerDelegate
@property (nonatomic, strong) NSMutableIndexSet *deletedSectionIndexes;
@property (nonatomic, strong) NSMutableIndexSet *insertedSectionIndexes;
@property (nonatomic, strong) NSMutableArray *deletedRowIndexPaths;
@property (nonatomic, strong) NSMutableArray *insertedRowIndexPaths;
@property (nonatomic, strong) NSMutableArray *updatedRowIndexPaths;
@end
@hisasann
hisasann / setExifInfoData.m
Created August 3, 2012 02:42
Exifを付与しNSDataを作成するサンプルコード
- (NSData *)setExifInfoData:(UIImage *)image date:(NSString *)date {
CGImageSourceRef cgImage = CGImageSourceCreateWithData((__bridge CFDataRef) UIImageJPEGRepresentation(image, 1), NULL);
NSMutableDictionary *exifDict = [[NSMutableDictionary alloc] init];
if ([StringUtil isNilToEmpty:date]) {
NSDateFormatter *outputFormatter = [[NSDateFormatter alloc] init];
[outputFormatter setDateFormat:@"yyyy:MM:dd HH:mm:ss"];
NSString *original = [outputFormatter stringFromDate:[NSDate date]];
[exifDict setObject:original forKey:(__bridge NSString *) kCGImagePropertyExifDateTimeOriginal];
[exifDict setObject:original forKey:(__bridge NSString *) kCGImagePropertyExifDateTimeDigitized];
@shikajiro
shikajiro / gist:3041123
Created July 3, 2012 17:15
Google SpreadsheetをJSONを返すダミーサーバーとして利用する方法
###
GoogleShpreadsheetのシートに記述されたデータをDBのテーブルに見立て取得し、
JSONに変換するスクリプト。
このソースはTitanium Mobileを想定しているが、コンバートの処理は流用できる。
テストに使用しているShpreadsheetは以下
https://docs.google.com/spreadsheet/ccc?key=0AuCUD7G5hGZrdGlBbHBDVElfUXdsbWRkRThVcmdCalE
条件:1行目をカラム名にすること
LEFT JOINなどの処理は別途本気出して実装する必要あり。
@mwaterfall
mwaterfall / gist:953657
Created May 3, 2011 16:24
Runtime iOS Version Checking
/*
* System Versioning Preprocessor Macros
*/
#define SYSTEM_VERSION_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame)
#define SYSTEM_VERSION_GREATER_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending)
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending)