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 / MessageBox.cs
Last active December 16, 2015 14:29
MessageBox.Show for Xamarin.iOS description: http://blog.ch3cooh.jp/entry/20130425/1366875327
using System;
using System.Drawing;
using MonoTouch.UIKit;
using MonoTouch.Foundation;
using System.Collections.Generic;
namespace MonoTouch.UIKit
{
public enum MessageBoxResult
{
@CH3COOH
CH3COOH / gist:5520429
Last active December 17, 2015 00:19
Send SMS using Skype4COM for C# Detailed description: http://ch3cooh.jp/other/skype-api/send-msm-using-skypeapi/
using System;
using System.Diagnostics;
using System.Windows.Forms;
namespace SkypeAPISample
{
public partial class Form1 : Form
{
public Form1()
{
@CH3COOH
CH3COOH / gist:5599790
Last active December 17, 2015 11:09
Localization strings. for example; https://itunes.apple.com/ja/app/id635224999?mt=8
Last update: 2013/5/29
Order by
・English
・Japanese
・Chinese (hant)
・Chinese (hans)
・Korean
・French
@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
@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: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 / 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 / GroupedItemsPage.xaml
Last active August 29, 2015 13:55
「WindowsストアアプリでGridViewのアイテムごとに押されたエフェクトアニメーションを実行しないようにする」で使っているXAML
<Page
x:Name="pageRoot"
x:Class="NoPushSample.GroupedItemsPage"
DataContext="{Binding DefaultViewModel, RelativeSource={RelativeSource Self}}"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:NoPushSample"
xmlns:data="using:NoPushSample.Data"
xmlns:common="using:NoPushSample.Common"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
@CH3COOH
CH3COOH / gist:9182088
Created February 24, 2014 04:45
LiveConnectClientインスタンスの生成処理 for WinRT
public async Task UploadAsync(IEnumerable<Windows.Storage.IStorageFile> files)
{
var authClient = new LiveAuthClient();
var result = await authClient.InitializeAsync(ScopesLiveSdk);
var client = new LiveConnectClient(result.Session);
@CH3COOH
CH3COOH / gist:4b2b3adac840eed9de78
Created September 20, 2014 07:39
東京メトロ オープンデータ API の遅延情報取得例
static void Hoge()
{
var endPoint = "https://";
var parm = new Dictionary<string, string>();
parm["rdf:type"] = "odpt:TrainInformation";
parm["acl:consumerKey"] = アクセスキー";
var url = string.Format("{0}?{1}", endPoint,
string.Join("&", parm.Select(p => string.Format("{0}={1}", p.Key, p.Value))));