Skip to content

Instantly share code, notes, and snippets.

public interface AvailabilityChecker {
Observable<ValidationResult<String>> isEmailAvailable(@NonNull String email);
Observable<ValidationResult<String>> isUsernameAvailable(@NonNull String email);
ValidationResult<String> isEmailAvailableSync(@NonNull String email);
ValidationResult<String> isUsernameAvailableSync(@NonNull String email);
}
public interface AvailabilityChecker {
Observable<ValidationResult<String>> isEmailAvailable(@NonNull String email);
Observable<ValidationResult<String>> isUsernameAvailable(@NonNull String email);
ValidationResult<String> isEmailAvailableSync(@NonNull String email);
ValidationResult<String> isUsernameAvailableSync(@NonNull String email);
}
@sfszh
sfszh / g3-swagger.yaml
Last active June 9, 2017 23:09
g3-swagger.yaml
swagger: '2.0'
info:
description: >-
This is a sample server Petstore server. You can find out more about
Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net,
#swagger](http://swagger.io/irc/). For this sample, you can use the api
key `special-key` to test the authorization filters.
version: 1.0.0
title: Swagger Petstore
termsOfService: 'http://swagger.io/terms/'
@sfszh
sfszh / outline.shader
Created November 21, 2014 03:30
add an outline for model in unity3d
Shader "Outline" {
Properties {
_Color ("Main Color", Color) = (.5,.5,.5,1)
_OutlineColor ("Outline Color", Color) = (0,0,0,1)
_Outline ("Outline width", Range (0.0, 0.03)) = .005
_MainTex ("Base (RGB)", 2D) = "white" { }
}
CGINCLUDE
#include "UnityCG.cginc"
struct appdata {
@sfszh
sfszh / UploadFile.py
Created January 9, 2014 10:01
upload file with ftp.
import os
import paramiko, base64
""" only add file here, if you delete file in the client, server wont delete
"""
luaRoot = './www/game/test/luaRoot/'
def LoginServer(serverRoot, username, psw):
transport = paramiko.Transport((serverRoot,22))
transport.connect(username = username, password = psw)
@sfszh
sfszh / printallfiles.py
Created January 3, 2014 09:21
print all files including directories
import os
def Test2(rootDir, filehandle):
for lists in os.listdir(rootDir):
path = os.path.join(rootDir, lists)
print path
filehandle.write(path + '\n')
if os.path.isdir(path):
Test2(path,filehandle)
if __name__ == '__main__':
#define DEBUG_CONSOLE
#define DEBUG_LEVEL_LOG
#define DEBUG_LEVEL_WARN
#define DEBUG_LEVEL_ERROR
#if (UNITY_EDITOR || DEVELOPMENT_BUILD)
#define DEBUG
#endif
#if (UNITY_IOS || UNITY_ANDROID)
@sfszh
sfszh / Loom.cs
Created August 12, 2013 01:49
a simple thread generator using in unity
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System;
using System.Threading;
using System.Linq;
public class Loom : MonoBehaviour
{
public static int maxThreads = 8;
using UnityEngine;
using UnityEditor;
/**
* originally by buffonomics
* originally posted on: http://forum.unity3d.com/threads/77444-How-to-create-new-GameObject-as-child-in-hierarchy
*/
public class SmartCreate : MonoBehaviour {
[MenuItem("GameObject/Create Empty Parent #&e")]
static void createEmptyParent() {
using UnityEngine;
using UnityEditor;
/*
* orignially posted
http://answers.unity3d.com/questions/179775/game-window-size-from-editor-window-in-editor-mode.html
*/
public class SetGameViewSize : EditorWindow {
private Vector2 _size = new Vector2(800, 600);