Skip to content

Instantly share code, notes, and snippets.

View akio46's full-sized avatar

Akio Yamadera akio46

  • Liverowing, Denver, USA
  • Chiba, Japan
View GitHub Profile
+ (HealthKitManager *)sharedManager {
static dispatch_once_t pred = 0;
static HealthKitManager *instance = nil;
dispatch_once(&pred, ^{
instance = [[HealthKitManager alloc] init];
instance.healthStore = [[HKHealthStore alloc] init];
instance.connected = [[NSUserDefaults standardUserDefaults] boolForKey:APPLE_HEALTHKIT_CONNECTION];
});
return instance;
}
@akio46
akio46 / gist:bee3fb6bc2141d8695a1a343a54d0051
Created December 1, 2016 17:49
get screenshot image of specific view
- (UIImage *)getSnapshotFromView:(UIView *)v {
UIGraphicsBeginImageContextWithOptions(v.bounds.size, NO, 0.0f);
CGContextRef context = UIGraphicsGetCurrentContext();
[v.layer renderInContext:context];
UIImage *snapshotImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return snapshotImage;
}
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
import { SplitTextBoxModule } from '../common/split-text-box/split-text-box.module';
import { DateTimeModule } from '../common/datetime/datetime.module';
import { DateTimeRangeModule } from '../common/datetime-range/datetime-range.module';
import { TooltipModule } from '../common/tooltip/tooltip.module';
import { Component, OnInit } from '@angular/core';
import { DateRange } from '../common/datetime-range/datetime-range.component';
@Component({
selector: 'sample',
templateUrl: 'app/component/sample/sample.component.html',
styleUrls: ['app/component/sample/sample.component.css']
})
export class SampleComponent {
@akio46
akio46 / TSAPIHandler.swift
Created July 6, 2017 03:21
AlamoFire, ObjectMapper, SwiftyJSON
//
// TSAPIHandler.swift
// ToeSlip
//
// Created by Akio Yamadera on 11/16/16.
// Copyright © 2015 mobilosophy LLC. All rights reserved.
//
// All of server/client communication functions are defined in this class
// Alamofire which is swift port of AFNetworking which is proven and widely used in Objective C

Keybase proof

I hereby claim:

  • I am akio46 on github.
  • I am akio46 (https://keybase.io/akio46) on keybase.
  • I have a public key ASCYfkKvrRfsuWbc7tcyXp0dfcbcLYySmFVnFJhMfNJ9Vwo

To claim this, I am signing this object: