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:165cdb30900f2c738c0c
Last active August 29, 2015 14:24
Realm-Javaのバグっぽい挙動
// Piyo class
public class Piyo extends RealmObject {
@PrimaryKey
private int id;
}
public static RealmResults<Piyo> getPiyo(Realm realm, List<Integer> ids) {
RealmQuery<Piyo> q = realm.where(Piyo.class);
@CH3COOH
CH3COOH / gist:dd8e47173edb572faf18
Created February 19, 2015 16:56
田村ゆかりさんの誕生日
// 田村ゆかりさんの誕生日
var yukariBirthday = new DateTime(1976, 2, 27);
// 現在の年月日
var nowDate = DateTime.Now.Date;
// 経過日数を調べる
var totalDays = nowDate.Subtract(yukariBirthday).TotalDays;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
namespace Kyuko
{
public class RouteConfig
@CH3COOH
CH3COOH / gist:2bb73cfce69d39ff4907
Created October 17, 2014 09:54
Xamarin.iOS(iPhone 5s iOS 8シミュレータ)でエラーが発生する
using (var client = new System.Net.Http.HttpClient() { BaseAddress = new Uri("http://blog.ch3cooh.jp/") })
{
try
{
var hoge = await client.GetStringAsync("/entry/20141018/1413595800");
}
catch (Exception ex)
{
//
}