Skip to content

Instantly share code, notes, and snippets.

@cppleon
cppleon / Awesome-Game-Networking.md
Created August 7, 2020 17:55
Curated list of Awesome Game Networking resources. Github URL: https://github.com/MFatihMAR/Awesome-Game-Networking

Awesome Game Networking Awesome

Curated list of Awesome Game Networking resources which is continuously being updated!

Please feel free to contribute after reading contribution guidelines.

Contents

@cppleon
cppleon / progrids-install.md
Created December 4, 2019 07:55 — forked from roydejong/progrids-install.md
Installing ProGrids v3 in Unity 2018.3

The problem

ProGrids seems to have disappeared from the Unity Package Manager as of Unity 2018.3.

It is possible to install ProGrids v2 via the Asset Store, but it's an old and incompatible version.

The solution

To install, you need to import the package manually:

  1. Navigate to your project directory on disk.
  2. Open the manifest.json file in the Packages directory for editing.
@cppleon
cppleon / uuidv4test.js
Created November 11, 2019 10:48 — forked from johnelliott/uuidv4test.js
uuid v4 regex
import { v4 as uuid } from 'uuid';
export function generateId() {
return uuid();
}
const v4 = new RegExp(/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i);
console.log(generateId().match(v4));
//console.log(generateId().length)
@cppleon
cppleon / RPCDemo.cs
Created November 8, 2019 22:12 — forked from tejacques/RPCDemo.cs
C# Async Mini RPC Demo
using ServiceStack.Text;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
@cppleon
cppleon / dom.service.ts
Created May 25, 2019 09:42 — forked from caroso1222/dom.service.ts
Service to dynamically append Angular components to the body
import {
Injectable,
Injector,
ComponentFactoryResolver,
EmbeddedViewRef,
ApplicationRef
} from '@angular/core';
@Injectable()
export class DomService {
@cppleon
cppleon / nodejs-custom-es6-errors.md
Created June 4, 2018 19:22 — forked from slavafomin/nodejs-custom-es6-errors.md
Custom ES6 errors in Node.js

Here's how you could create custom error classes in Node.js using latest ES6 / ES2015 syntax.

I've tried to make it as lean and unobtrusive as possible.

Defining our own base class for errors

errors/AppError.js

@cppleon
cppleon / EXIF image orientation CSS transform fix.js
Created March 29, 2018 07:03 — forked from nezed/EXIF image orientation CSS transform fix.js
EXIF image orientation CSS transform fix / fix orientation of image picked from local FS without canvas
/*
* This gist will help you to fix orientation
* of image picked from local FS
* without canvas.
* CSS-only!
*
* @expample
* const img = document.createElement('img')
* img.src = URL.createObjectURL(file)
* img.style.transform = ORIENT_TRANSFORMS[ getOrientation(file) ]
@cppleon
cppleon / facebook_leads.md
Created December 7, 2017 06:30 — forked from tixastronauta/facebook_leads.md
Receiving Facebook Leads on a Webhook

Receiving Facebook Leads on a Webhook

1 - Create an App

Head over to developer.facebook.com and create an App

2 - Setup the webhook

On your server, create a facebook webhook that will handle facebook calls. Then create a "leadgen" webhook on you App: https://developers.facebook.com/docs/graph-api/webhooks/v2.5

@cppleon
cppleon / custom-error.js
Created July 24, 2017 20:15 — forked from justmoon/custom-error.js
Creating custom Error classes in Node.js
'use strict';
module.exports = function CustomError(message, extra) {
Error.captureStackTrace(this, this.constructor);
this.name = this.constructor.name;
this.message = message;
this.extra = extra;
};
require('util').inherits(module.exports, Error);
@cppleon
cppleon / flexbox-layout.css
Created June 7, 2017 20:58 — forked from addyosmani/flexbox-layout.css
Flexbox layout helper classes
/*
Flexbox CSS helpers from the Polymer team. Extracted from https://github.com/PolymerElements/iron-flex-layout for use as just CSS.
Docs: https://elements.polymer-project.org/guides/flex-layout
@license
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt