Skip to content

Instantly share code, notes, and snippets.

@Thaina
Thaina / ForwardLights.cs
Last active February 16, 2020 06:36
Fix ambient light not set in the com.unity.render-pipelines.universal@7.2.0
using UnityEngine.Experimental.GlobalIllumination;
using Unity.Collections;
namespace UnityEngine.Rendering.Universal.Internal
{
/// <summary>
/// Computes and submits lighting data to the GPU.
/// </summary>
public class ForwardLights
{
@Thaina
Thaina / keybindings.json
Last active January 3, 2020 08:26
my vscode
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "tab",
"command": "-acceptSelectedSuggestion",
"when": "editorTextFocus && suggestWidgetVisible"
}
]
@Thaina
Thaina / ObjectProxyOperator.tt
Last active September 3, 2019 09:38
T4 file for generate common operator on C# object
<#@ output extension=".cs" #>
class ObjectProxyOperator
{
<#
{
var types = new[]{ "sbyte","byte","short","ushort","int","uint","long","ulong","float","double","decimal" };
foreach(var pair in new System.Collections.Generic.Dictionary<string,string>() { ["Add"] = "+",["Subtract"] = "-",["Multiply"] = "*",["Divide"] = "/",["Mod"] = "%" })
{
var func = pair.Key;
var op = pair.Value;
@Thaina
Thaina / bitbucket-pipelines.yml
Created July 31, 2016 10:34
Bitbucket Pipeline publish to AWS Lambda with version
image: python:3.5.1
pipelines:
default:
- step:
script: # Modify the commands below to build and test your repository.
- apt-get update
- apt-get install -y zip
- zip -r $BITBUCKET_REPO_SLUG".zip" *
- pip install awscli
using System;
using System.Linq;
using System.Collections.Generic;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Google.Protobuf;
using Google.Protobuf.Collections;
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
function (doc,req) {
if(!req.id)
return [null,{ message : "Support only PUT with id" }];
if(!doc)
doc = { "_id":req.id };
var data = JSON.parse(req.body);
delete data._id;
delete data.id;
var resolved = false;
var resolving;
/* global FB */
var fbResolver = new Promise((resolve,reject) => {
if(resolved)
return resolve();
resolving = resolve;
});
@Thaina
Thaina / MiniJSON.cs
Created June 29, 2016 07:42 — forked from darktable/MiniJSON.cs
Unity3D: MiniJSON Decodes and encodes simple JSON strings. Not intended for use with massive JSON strings, probably < 32k preferred. Handy for parsing JSON from inside Unity3d.
/*
* Copyright (c) 2013 Calvin Rien
*
* Based on the JSON parser by Patrick van Bergen
* http://techblog.procurios.nl/k/618/news/view/14605/14863/How-do-I-write-my-own-parser-for-JSON.html
*
* Simplified it so that it doesn't throw exceptions
* and can be used in Unity iPhone with maximum code stripping.
*
* Permission is hereby granted, free of charge, to any person obtaining
/** @param {string} id
* @param {string} secret */
function BitBucket(id, secret){
this.auth = AccessToken(id, secret);
this.Commit = function(repo,branch,message,files){
return Commit(repo,branch,message,files,this.auth.access_token);
}
}
/** @param {string} id