Skip to content

Instantly share code, notes, and snippets.

View synboo's full-sized avatar

Shu Shimbo synboo

  • TimeTree, Inc.
  • Tokyo, Japan
View GitHub Profile
@synboo
synboo / vscamera.md
Created March 6, 2019 00:53
Virtual Studio Camera - Privacy Policy

Virtual Studio Camera - Privacy Policy

VGJIRO built the Virtual Studio Camera app as a Free app. This SERVICE is provided by VGJIRO at no cost and is intended for use as is.

This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service.

If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy.

The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which is accessible at Virtual Studio Camera unless otherwise defined in this Privacy Policy.

@synboo
synboo / document_location.swift
Created May 17, 2017 09:45
Find CoreData's sqlite file location.
/// http://stackoverflow.com/a/27461267/1837541
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
let paths = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)
print(paths[0])
return true
}
@synboo
synboo / property.md
Last active December 31, 2015 17:18
nonatomic vs. atomic copy vs. strong(retain) vs. assign

nonatomic vs. atomic

  • Use nonatomic

copy vs. strong(retain) vs. assign

  • copy: Mutable系のサブクラスがあるNSObject
  • strong(retain): Mutable系のサブクラスがないNSObject
  • assign: NSObjectでないC由来のプロパティ
#define AppDelegate ((TSTAppDelegate *)[[UIApplication sharedApplication] delegate])
// Color
#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
#define UIColorFromRGBWithAlpha(rgbValue,a) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:a]
- (void)testTwitter
{
// Step 0: Check that the user has local Twitter accounts
BOOL isTwitterAvailable = [SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter];
NSLog(@"isTwitterAvailable:%d", isTwitterAvailable);
if (isTwitterAvailable) {
// Step 1: Obtain access to the user's Twitter accounts
ACAccountStore *accountStore = [[ACAccountStore alloc] init];
@synboo
synboo / get_ajax_params.js
Last active December 16, 2015 02:09
Generate params object for jQuery ajax request by using input and textarea tags.
function get_ajax_params()
{
var
params = {},
inputs = $('form').serializeArray();
$.each(inputs, function (i, input) {
params[input['name']] = input['value'];
});
return params;
}

Objective-C

インスタンスの生成と初期化

instance = [[SomeClass alloc] init];

クラス定義

@synboo
synboo / lru.php
Created February 18, 2012 14:30
LRU (Last Recently Used) cache
<?php
/**
* LRU is a system which cache data used last recently.
* see more: http://www.slideshare.net/t_wada/tddbc-exercise
*/
class LRU
{
protected $_cache = array();