Skip to content

Instantly share code, notes, and snippets.

@hhyyg
hhyyg / OpenURL.cs
Created July 30, 2017 06:34
Adaptive Card Action Sample
/*
using AdaptiveCards;
using Microsoft.Bot.Builder.Dialogs;
using Microsoft.Bot.Connector;
using System.Collections.Generic;
*/
/// <summary>
/// URLを開くカード
/// </summary>
@hhyyg
hhyyg / Script.csx
Last active August 7, 2017 13:04
Thanks: Dave Glick - Announcing Scripty https://daveaglick.com/posts/announcing-scripty
using Microsoft.CodeAnalysis;
using System.Web;
using System.Linq;
using System.Collections.Generic;
using System.Reflection;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.CSharp.Extensions;
@hhyyg
hhyyg / swift.md
Last active September 1, 2017 12:27
感想ノート:Swift実践入門 ── 直感的な文法と安全性を兼ね備えた言語 (WEB+DB PRESS plus) | 石川 洋資, 西山 勇世 | Amazon https://www.amazon.co.jp/dp/4774187305/?tag=aokj24gaw-22

Plagrounds で試すことについて

  • 他のファイルのコンパイルエラーが影響してしまう場合がある。その時は再起動。

Swift Package Manager

swift package generate-xcodeproj でXcodeのプロジェクトファイルを生成する。

フォルダ構成とPackage.swiftにしたがって、必要に応じて�プロジェクトファイルとか作る感じ >SwiftPMはクロスプラットフォームだけど、プロジェクトファイルはMacのXcode用なので

@hhyyg
hhyyg / protocol static method.swift
Created August 30, 2017 04:33
protocol static 実験
protocol Person {
static func memo()
}
class Taro: Person {
static func memo() {
print("taro")
@hhyyg
hhyyg / C# 6 exception filter.cs
Last active September 27, 2017 06:57
C# note
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp6
{
class Program2
{
@hhyyg
hhyyg / 1.SearchViewController.swift
Last active September 18, 2023 13:16
SearchViewController for iOS 11. Enable large title. Thanks: 【Swift】UISearchControllerの使い方。検索結果用ビューコントローラーを呼び出す。 | はじはじアプリ体験記 http://hajihaji-lemon.com/smartphone/swift/uisearchcontroller/
//
// SearchViewController.swift
// Gistan
//
// Created by Hiroka Yago on 2017/10/07.
// Copyright © 2017 miso. All rights reserved.
//
import UIKit
@hhyyg
hhyyg / linq from in.cs
Last active October 26, 2017 03:15
Linq の from in を思い出す
using System;
using System.Linq;
public class Program
{
public static void Main()
{
int[] nums = new int[] { 1, 2, 3, 4 };
var q1 = from a in nums
@hhyyg
hhyyg / a.cs
Last active November 30, 2017 06:18
blog code. Sample GraphQL for .NET
static void My()
{
ISchema schema = Schema.For(@"
type Query {
user: String
}
");
//データを用意
var root = new { User = "Taro" };
@hhyyg
hhyyg / HogeViewController.swift
Last active December 6, 2017 02:16
Protocol Extension で、ストレージに保存するメソッドを定義すると綺麗になるかもと思ってやってみたが、うまくいかなかった。
//書きたい例
var meals = [Meal]()
//mealsをストレージに保存する
private func saveMeals() {
meals.store(at: Meal.archiveUrl)
}
//mealsをストレージから取得する
private func loadMeals() -> [Meal]? {