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
#include <iostream> | |
#include <chrono> | |
#include <memory> | |
#include <functional> | |
using namespace std; | |
using namespace std::chrono; | |
class Base | |
{ |
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.Collections; | |
using System.Collections.Generic; | |
using System.Security.Cryptography; | |
using System.Text; | |
public class WebAssetHolder : MonoBehaviour { | |
public class WebItem { |
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
// C++11 32bit FNV-1 and FNV-1a string hasing (Fowler–Noll–Vo hash) | |
// | |
// Requires a compiler with C++11 support | |
// See main(...) for examples | |
#include <iostream> | |
#include <cassert> | |
namespace hash | |
{ |
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
template<typename T, T... _Rest> | |
struct array_pack; | |
template<typename T> | |
struct array_pack<T>{}; | |
template<typename T, T _This, T... _Rest> | |
struct array_pack<T, _This, _Rest...> : private array_pack<T, _Rest...> | |
{ | |
const T & operator[](const int pos) | |
{ | |
//as cpp memory layout, indexing reversely |
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
public static int getVersionCode(Context ctx) { | |
int versionCode = 0; | |
try { | |
PackageInfo pInfo = ctx.getPackageManager().getPackageInfo( | |
ctx.getPackageName(), 0); | |
versionCode = pInfo.versionCode; | |
} catch (PackageManager.NameNotFoundException e) { | |
e.printStackTrace(); | |
} |
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
[Ll]ibrary/ | |
[Tt]emp/ | |
[Oo]bj/ | |
[Bb]uild/ | |
[Dd]ebug/ | |
[Rr]elease/ | |
# Autogenerated VS/MD solution and project files | |
*.csproj | |
*.unityproj |
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
public class UTF8 | |
{ | |
/// <summary> | |
/// 计算utf-8编码后的字节数 | |
/// </summary> | |
/// <param name="code">Unicode</param> | |
/// <returns>utf-8编码后的字节数</returns> | |
public static int GetByteCount(int code) | |
{ |
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 UnityEditor; | |
using System.IO; | |
public class ReimportUnityEngineUI | |
{ | |
[MenuItem("Assets/Reimport UI Assemblies", false, 100)] | |
public static void ReimportUI() | |
{ | |
#if UNITY_4_6 |
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; | |
using System.Globalization; | |
using System.Text; | |
namespace Procurios.Public | |
{ | |
/// <summary> | |
/// This class encodes and decodes JSON strings. | |
/// Spec. details, see http://www.json.org/ |
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
import Foundation | |
// 1. Wildcard Pattern | |
func wildcard(a: String?) -> Bool { | |
guard case _? = a else { return false } | |
for case _? in [a] { | |
return true | |
} | |