Skip to content

Instantly share code, notes, and snippets.

⚗️
Transform code into magic

Yemi soyemi

Block or report user

Report or block soyemi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@soyemi
soyemi / chaining.cs
Created Sep 27, 2018
Method chaining Pattern with generic derivation.C# and Typescript
View chaining.cs
public class A<T> where T :A<T>{
protected T t;
public T funcA(){
return t;
}
}
public class A:A<A>{
private A(){
@soyemi
soyemi / float16.ts
Last active Sep 29, 2018
Float16 implement Javascript
View float16.ts
export class Float16{
public static ByteToFloat16(uint16:number){
let d = uint16;
let negative = ((d>>15) & 1) !=0;
let mask = 0b11111;
let exponent = (d >>10) & mask;
let significand = d & 0b1111111111;
if(exponent == 0 && significand == 0){
return negative ? -0:0;
}
@soyemi
soyemi / binding.ts
Created Sep 12, 2018
Typescript Object property binding.
View binding.ts
function BindFunc(tar:object,property:string,f:(v:any)=>void){
var property_emit = BIND_EMITTER(property);
if(tar.hasOwnProperty(property_emit)){
tar[property_emit].push(f);
}
else{
BindSetup(tar,property);
tar[property_emit].push(f);
}
}
@soyemi
soyemi / MeshSerialization.cs
Created Jun 12, 2018
Unity mesh binary serialzation.
View MeshSerialization.cs
using System.Collections.Generic;
using UnityEngine;
using System.Runtime.InteropServices;
using System;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
[ExecuteInEditMode]
public class MeshSerialization : MonoBehaviour {
@soyemi
soyemi / config.json
Created Jun 12, 2018
使用Gulp构建Egret微信小游戏
View config.json
{
"projectfolder": "TestMap",
"wxappid": "wx6ac********",
"projectname":"testproj",
"res":{
"compressFolders": [
"spriteatlas",
"UIAtlas"
]
},
@soyemi
soyemi / SpriteMeshMerger.cs
Created May 17, 2018
Unity editor script for merging sprite render sprites into a single large mesh.
View SpriteMeshMerger.cs
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEditor;
public class SpriteMeshMerger
{
@soyemi
soyemi / SpriteAtlasExporter.cs
Created May 17, 2018
Script for exporting Unity sprite packer atlas texture.
View SpriteAtlasExporter.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.IO;
public class SpriteAtlasExporter : MonoBehaviour {
public Sprite sprite;
RenderTexture tex;
@soyemi
soyemi / JsonHelper.cs
Created Mar 14, 2018
Json.Net.JsonConverter for Unity Vector struct.
View JsonHelper.cs
using UnityEngine;
using Newtonsoft.Json;
using System;
public class Vec4Conv : JsonConverter
{
public override bool CanConvert(Type objectType)
{
if (objectType == typeof(Vector4))
@soyemi
soyemi / GradleConfig.cs
Created Mar 5, 2018
Single file C# gradle file parser
View GradleConfig.cs
using System.Collections.Generic;
using UnityEngine;
using System.IO;
using System.Text;
using System;
using Newtonsoft.Json;
namespace CIS
{
public class GradleConfig
@soyemi
soyemi / DomainDX.cs
Created Jan 31, 2018
Cross AppDomain DirectX11(SharpDX) Drawing Test
View DomainDX.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SharpDX;
using SharpDX.Direct3D11;
using SharpDX.DXGI;
using System.Threading;
using Device = SharpDX.Direct3D11.Device;
You can’t perform that action at this time.