Skip to content

Instantly share code, notes, and snippets.

OmarShehata / bitmap.html
Last active Feb 5, 2019
Benchmark for createImageBitmap. Live version:
View bitmap.html
<!DOCTYPE html>
canvas {
OmarShehata / ArcadeGame.js
Created Jul 31, 2018
CesiumJS Experimental Camera Tacking Class
View ArcadeGame.js
/*global define*/
OmarShehata / TypedArrays.html
Last active Oct 6, 2018
Sample test of Javascript Typed Arrays
View TypedArrays.html
<!DOCTYPE html>
<title>Javascript Typed Arrays</title>
<meta charset="UTF-8">
<script type="text/javascript" src=""></script>
<script type="text/javascript">
// Here's a sample string
OmarShehata / Water.vert
Created Feb 3, 2018
Answer to the water waves challenge
View Water.vert
attribute vec3 aPosition;
uniform mat4 matrix_model;
uniform mat4 matrix_viewProjection;
uniform float uTime;
void main(void)
vec3 pos = aPosition;
OmarShehata / index.html
Created Jun 5, 2017
Final client code for step 1 of the Tuts+ Multiplayer Pirate Game Tutorial.
View index.html
<meta charset="UTF-8" />
<title>Multiplayer Experiment</title>
<!-- Load the Phaser game library -->
<script src=""></script>
<!-- Load the networking library -->
<script src="/"></script>
<!-- Some simple styles and fonts -->
OmarShehata / socket.js
Last active Aug 12, 2022 simple cheat sheet
View socket.js
io.on('connection', function(socket){
/* 'connection' is a special event fired on the server when any new connection is made */
socket.on('disconnect', function(){
/* When this individual socket has disconnected, this special event fires */
/* This will send the event 'foobar' with the data to
every connected to socket */
OmarShehata / RebindAction.cpp
Created Jun 1, 2017
Rebinding Keys at runtime in Unreal Engine 4.
View RebindAction.cpp
void RebindAction(FName ActionName, FKey NewKey) {
// Adapted from Rama's VictoryBPFunctionLibrary (
UInputSettings* Settings = const_cast<UInputSettings*>(GetDefault<UInputSettings>());
if (Settings) {
TArray<FInputActionKeyMapping>& Actions = Settings->ActionMappings;
for (FInputActionKeyMapping& Each : Actions)
if (Each.ActionName == ActionName) {
Each.Key = NewKey;
UE_LOG(LogTemp, Warning, TEXT("%s is triggered by %s"), *Each.ActionName.ToString(), *Each.Key.ToString());
OmarShehata / Text.js
Created Feb 10, 2017
Create an in-game text object in the PlayCanvas engine
View Text.js
var Text = pc.createScript('text');
Text.attributes.add('text', { type: 'string', default:'Hello World!' });
Text.attributes.add('fontsize', { type: 'number', default:70, title:"Font Size" });
// initialize code called once per entity
Text.prototype.initialize = function() {
// Create a canvas to do the text rendering
this.canvas = document.createElement('canvas');
this.canvas.height = 128;
OmarShehata / Pixi.js Smoke Shader
Created May 16, 2016
Example of smoke shader in Pixi.js
View Pixi.js Smoke Shader
<!DOCTYPE html>
<title>PixiJS Shaders</title>
<style type="text/css">
body {
margin: 0;
overflow: hidden;
View Phaser Template.html
<meta charset="UTF-8" />
<title>hello phaser!</title>
<script src="phaser.min.js"></script>
<script type="text/javascript">
window.onload = function() {