Skip to content

Instantly share code, notes, and snippets.

View ebleme's full-sized avatar

Mehmet Ali ebleme

  • Türkiye
View GitHub Profile
@ebleme
ebleme / BetterWaitForSeconds.cs
Created July 18, 2022 08:29 — forked from yasirkula/BetterWaitForSeconds.cs
WaitForSeconds manager that reuses instances to avoid GC in Unity
using System.Collections.Generic;
using UnityEngine;
public static class BetterWaitForSeconds
{
private class WaitForSeconds : CustomYieldInstruction
{
private float waitUntil;
public override bool keepWaiting
{
@ebleme
ebleme / HOC.js
Created January 31, 2022 09:50 — forked from Restuta/HOC.js
React HOC (Higher Order Component) Example
/* HOC fundamentally is just a function that accepts a Component and returns a Component:
(component) => {return componentOnSteroids; } or just component => componentOnSteroids;
Let's assume we want to wrap our components in another component that is used for debugging purposes,
it just wraps them in a DIV with "debug class on it".
Below ComponentToDebug is a React component.
*/
//HOC using Class
//it's a function that accepts ComponentToDebug and implicitly returns a Class
let DebugComponent = ComponentToDebug => class extends Component {