Skip to content

Instantly share code, notes, and snippets.

View geggleto's full-sized avatar

Glenn Eggleton geggleto

View GitHub Profile
import RedisClient from "../persistence/clients/RedisClient";
import { EntityManager } from '@mikro-orm/core';
import { FriendModel } from '../models/Friend';
import { QueryBus } from '../infrastructure/QueryBus';
import { ListFriendsQuery } from './Queries/ListFriendsQuery';
import { ListFriendsHandler } from './Handlers/ListFriendsHandler';
import {ListIncomingRequestsQuery} from "./Queries/ListIncomingRequestsQuery";
import {ListOutgoingRequestsQuery} from "./Queries/ListOutgoingRequestsQuery";
import {ListIncomingRequestsHandler} from "./Handlers/ListIncomingRequestHandler";
import {ListOutgoingRequestsHandler} from "./Handlers/ListOutgoingRequestHandler";
@geggleto
geggleto / README.md
Created December 8, 2019 06:44
Crypto Voxel Scripting

CryptoVoxel Scripting Engine Library

Superduper proof of concept messaging mechanism for CryptoVoxels

Goals

  1. Teleporters
  2. Stretch goal .... Battle Bot Pit with Players controlling their bots for all to watch

Facets

[{"constant":true,"inputs":[{"name":"_interfaceID","type":"bytes4"}],"name":"supportsInterface","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"cfoAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_tokenId","type":"uint256"},{"name":"_preferredTransport","type":"string"}],"name":"tokenMetadata","outputs":[{"name":"infoUrl","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"promoCreatedCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_tokenId","type":"uint256"}],"name":"approve","outputs":[],"payable":
pragma solidity ^0.4.18;
/// @title GeneScience implements the trait calculation for new kitties
/// @author Axiom Zen, Dieter Shirley <[email protected]> (https://github.com/dete), Fabiano P. Soriani <[email protected]> (https://github.com/flockonus), Jordan Schalm <[email protected]> (https://github.com/jordanschalm)
contract GeneScience {
bool public isGeneScience = true;
uint256 internal constant maskLast8Bits = uint256(0xff);
@geggleto
geggleto / verify-address.js
Created September 22, 2018 05:29
Express Service to verify Metamask Message and recover Ethereum Account used to sign
/**
Locally / Non-SSL: node verify-address.js local
**/
const LOCAL = (process.argv[2] === "local");
const fs = require('fs');
const express = require('express');
const app = express();
const bodyParser = require('body-parser');
const http = require('http');
const https = require('https');
Count 17463 / 104000
violet : 1
cerulian : 2
googly : 5
chartreux : 6
spock : 8
whixtensions : 8
skyblue : 13
peach : 13
bloodred : 15
@geggleto
geggleto / gist:7abc7beb8d32d90c78c48dc797069048
Created February 14, 2018 03:52
Family Jewels Distribution Teaser based on the first 88000 kitties
Count 14687
tongue : 4312
laperm : 3325
raisedbrow : 2400
limegreen : 1393
tigerpunk : 1279
//Problem: Given an array of integers, find the pair of adjacent elements that has the largest product and return that product.
//[-23, 4, -3, 8, -12]
// -23 * 4 = -92
// 4 * -3 = -12
// -3 * 8 = -24
// 8 * -12 = -96
// Return -12
//Loop N-1 times starting at pos 0
class UserRequestValidator
{
public function __invoke(Request $request, Response $response $next)
{
$validator = new Validator();
//rules
<?php
namespace App;
use App\Services\ServerProviderFactory;
use Illuminate\Database\Eloquent\Model;
class Provider extends Model
{
public function service()