This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension URL: Decodable { | |
public static func decode(_ json: JSON) -> Decoded<URL> { | |
guard case .string(let str) = json else { return .failure(.typeMismatch(expected: "String", actual: json.description)) } | |
guard let url = URL(string: str) else { return .failure(.custom("\(str) does not confirm URL expression"))} | |
return pure(url) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using UniRx; | |
namespace NE.Model | |
{ | |
public class Game | |
{ | |
public IObservable<Unit> Run(Board board, Queue<Player> players, BehaviorSubject<Player> startingPlayer) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using UniRx; | |
using System; | |
using System.Linq; | |
namespace NE.Model | |
{ | |
using Result = Tuple<BuildingCard, IEnumerable<Card>>; | |
public class Carpenter : DeployableCard | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IEnumerator<IObservable<Result>> Sequence(Player invokedPlayer, Result iteratedResult) | |
{ | |
if (iteratedResult.Item1 == null) | |
yield return invokedPlayer.RequestCards(1) | |
.Select(c => new Result(c.First(), null)); | |
if (iteratedResult.Item2 == null) | |
yield return invokedPlayer.RequestCards(iteratedResult.Item1.Cost) | |
.Select(c => new Result(iteratedResult.Item1, c)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
########################################################################### | |
# Choose your ffmpeg version and your currently-installed iOS SDK version: | |
# | |
VERSION="2.0.2" | |
SDKVERSION="7.0" | |
ARCHS="armv7 armv7s i386" | |
# | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Windows.Forms; | |
public class WindowsNotifyIcon { | |
NotifyIcon notifyIcon; | |
public void RegisterNotifyIcon(Texture2D iconTexture) { | |
notifyIcon = new NotifyIcon(); | |
MemoryStream memStream = new MemoryStream(iconTexture.EncodeToPNG()); | |
memStream.Seek(0, SeekOrigin.Begin); | |
System.Drawing.Bitmap bitmap = new System.Drawing.Bitmap(memStream); |
NewerOlder