This file contains 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
import UIKit | |
import WebKit | |
// Disableing `WKWebView` user zooming by returning `nil` in `UIScrollViewDelegate`'s | |
// `viewForZooming` delegate method. | |
// On iOS 12, the delegate method only called when set the web view itself as the | |
// scroll view delegate. | |
class WebView: WKWebView {} |
This file contains 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
/* ************************************************************************** | |
Copyright 2012 Calvin Rien | |
(http://the.darktable.com) | |
Derived from a method in BuildManager, part of | |
VoxelBoy's Unite 2012 Advanced Editor Scripting Talk. | |
(http://bit.ly/EditorScripting) | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. |
This file contains 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
//: A UIKit based Playground for presenting user interface | |
import UIKit | |
import PlaygroundSupport | |
extension Notification { | |
struct UserInfoKey<ValueType>: Hashable { | |
let key: String | |
} | |
This file contains 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
import Foundation | |
var a = 123 | |
var cpa = a | |
class Miao {} | |
var c = Miao() | |
var cc = c | |
struct S {} | |
var s = S() |
This file contains 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
Shader "Custom/VVSnowShader" { | |
Properties { | |
_MainTex ("Base (RGB)", 2D) = "white" {} | |
_Bump ("Bump", 2D) = "bump" {} | |
_Snow ("Snow Level", Range(0,1) ) = 0 | |
_SnowColor ("Snow Color", Color) = (1.0,1.0,1.0,1.0) | |
_SnowDirection ("Snow Direction", Vector) = (0,1,0) | |
_SnowDepth ("Snow Depth", Range(0,0.3)) = 0.1 | |
} | |
SubShader { |
This file contains 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; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class Controller : MonoBehaviour { | |
UniWebView webView; | |
// Use this for initialization | |
void Start () { |
This file contains 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
//Solution goes in Sources | |
public struct Card: CustomStringConvertible { | |
enum Suit: String { | |
case spade = "♤", heart = "♡", club = "♧", diamond = "♢" | |
// It is not the standard Texas poker rule. All suits are considered equal. | |
// However, there is a test case to "brake tide by suit", in which "heart" is the largest. | |
var value: Int { | |
switch self { |
This file contains 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
import UIKit | |
protocol DefaultValue { | |
associatedtype Value: Decodable | |
static var defaultValue: Value { get } | |
} | |
@propertyWrapper | |
struct Default<T: DefaultValue> { | |
var wrappedValue: T.Value |
This file contains 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
require_relative "../config.rb" | |
gem 'xcodeproj', '>=0.19.4' | |
require 'xcodeproj' | |
PROJECT = 'Unity-iPhone' | |
TARGET = 'Unity-iPhone' | |
LIBRARY = 'Libraries' | |
### Export | |
def exportUnityProject |
This file contains 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.Collections; | |
using System.Collections.Generic; | |
/// <summary> | |
/// Mono singleton Class. Extend this class to make singleton component. | |
/// Example: | |
/// <code> | |
/// public class Foo : MonoSingleton<Foo> | |
/// </code>. To get the instance of Foo class, use <code>Foo.instance</code> |
NewerOlder