Skip to content

Instantly share code, notes, and snippets.

View CH3COOH's full-sized avatar
🍣
is my favorite sushi

Kenji Wada CH3COOH

🍣
is my favorite sushi
View GitHub Profile
@CH3COOH
CH3COOH / gist:19bc9e8f9f1ee5becf2537e45df77dc6
Last active November 25, 2017 11:25
ポケモンダメ計 2017/11/25
func testExample() {
//攻撃者: ガブリアス
//実数値: A 182
let 攻撃者レベル: Double = 50.0
let 攻撃者の攻撃力: Double = 182
//技: じしん(物理 威力100)
let 技の威力: Double = 100
let タイプ一致: Double = 1.5
Anker PowerCore 10000 Anker PowerCore 13000 Anker PowerCore+ 10050 QC3.0 Anker PowerCore+ 13400 QC3.0 Anker PowerCore Speed 10000 QC Poweradd Pilot X7 Kinps モバイルバッテリー 10000mAh TSUNEO 10000mAh
重さ 180g 259g 236g 308g 204g 440g 213g 177g
定格入力 5V, 2.4A 5V, 2.0A 5V, 2.0A 5V, 2.0A 5V, 2.0A 5V, 2.0A 5V, 2.0A 5V, 1.5A
定格出力 5V, 2.4A 5V, 3.0A 5-6V, 3A 5-6V, 3A 5-8V, 3A 5V, 3.4A*2 5V, 3.5A 5V, 2.1A/1,0A
容量 10000mAh 13000mAh 10050mAh 13000mAh 10000mAh 20000mAh 10000mAh 10000mAh
重量比 55 50 42 42 49 45 47 56.49
func upload(user: User?, asset: PHAsset?) -> Future<Attachment, TendonError> {
let promise = Promise<Attachment, TendonError>()
guard let user = user else {
promise.failure(TendonError.invalidUser)
return promise.future
}
guard let asset = asset else {
promise.failure(TendonError.argument)
return promise.future
}
@CH3COOH
CH3COOH / ViewController.swift
Created March 10, 2017 05:19
NSTextAttachmentが含まれているNSAttributedStringでは行間をあけることができない http://blog.ch3cooh.jp/entry/20170310/1489123042
//
// ViewController.swift
// MultipleLines
//
// Created by WADAKENJI on 2017/03/10.
// Copyright © 2017年 ch3cooh.jp. All rights reserved.
//
import UIKit
@CH3COOH
CH3COOH / ViewController.cs
Created January 5, 2017 01:36
Xamarin.Macでローカル通知をおこなう
using System;
using System.Collections.Generic;
using AppKit;
using Foundation;
namespace LocalNotification
{
public partial class ViewController : NSViewController
{
public ViewController(IntPtr handle) : base(handle)
@CH3COOH
CH3COOH / Podfile
Last active September 14, 2016 14:58
Swift3.0でRealmのビルドが通らない
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
target 'realm_sample' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for realm_sample
pod 'Realm', :git => 'https://github.com/realm/realm-cocoa.git', :submodules => true
@CH3COOH
CH3COOH / gist:6031750
Created July 18, 2013 18:33
バインディングをコンテンツ依存にしないというのはこんな感じ?
<Grid HorizontalAlignment="Right"
VerticalAlignment="Center"
Margin="0,0,20,0"
RenderTransformOrigin="0.5,0.5"
Width="{Binding ActualWidth, ElementName=innerGrid, Mode=OneWay}"
Height="{Binding ActualWidth, ElementName=innerGrid, Mode=OneWay}">
<Grid Name="innerGrid" Background="Blue" HorizontalAlignment="Center" VerticalAlignment="Bottom">
<TextBlock
Foreground="White"
@CH3COOH
CH3COOH / gist:6031217
Created July 18, 2013 17:28
いけちょ(@ikeda_shogouki)さんのコードを少し変更してみました。
<Grid HorizontalAlignment="Right"
VerticalAlignment="Center"
Margin="0,0,20,0"
RenderTransformOrigin="0.5,0.5"
Width="{Binding ActualWidth, ElementName=innnerTextBlock, Mode=OneWay}"
Height="{Binding ActualWidth, ElementName=innnerTextBlock, Mode=OneWay}">
<Grid Background="Blue" HorizontalAlignment="Center" VerticalAlignment="Bottom">
<TextBlock Name="innnerTextBlock"
Foreground="Black"
@CH3COOH
CH3COOH / AppDelegate.m
Last active December 17, 2015 20:59
iOSで遅延起動させてみた その2 ローディング画面->起動画面への遷移
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
// ローディング画面
self.viewControllerA = [[[ViewController alloc] initWithNibName:@"ViewController" bundle:nil] autorelease];
// 起動画面とする
self.viewControllerB = [[[MainViewController alloc] initWithNibName:@"MainViewController" bundle:nil] autorelease];
// まずはローディング画面を表示するでござる
@CH3COOH
CH3COOH / gist:5671102
Created May 29, 2013 15:17
iOSで遅延起動させてみた
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
// Override point for customization after application launch.
self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController" bundle:nil] autorelease];
//self.window.rootViewController = self.viewController;
//[self.window makeKeyAndVisible];
NSURLRequest *req = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:@"http://ch3cooh.jp/"]];
[NSURLConnection sendAsynchronousRequest:req