Skip to content

Instantly share code, notes, and snippets.

Avatar

Marco Alka minecrawler

View GitHub Profile
View BaseComponent.ts
export class BaseElement extends HTMLElement {
dirty: boolean = true;
root: ShadowRoot;
constructor(hideInternals: boolean = true) {
super();
this.root = this.attachShadow({ mode: hideInternals ? 'closed' : 'open' });
const observer = new MutationObserver(() => {
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>loop over array</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@minecrawler
minecrawler / main.cpp
Created Aug 8, 2017
Guess random number game
View main.cpp
#include <chrono>
#include <iostream>
#include <random>
#include <string>
using namespace std;
using namespace std::chrono;
int main() {
int playerGuess = 0;
@minecrawler
minecrawler / main.rs
Created Mar 22, 2017
Simple Snake implemented on top of Amethyst
View main.rs
extern crate rand;
extern crate amethyst;
use amethyst::{Application, Event, State, Trans, VirtualKeyCode, WindowEvent};
use amethyst::asset_manager::AssetManager;
use amethyst::config::Element;
use amethyst::ecs::{World, Join, VecStorage, Component, RunArg, System, Entity};
use amethyst::ecs::components::{Mesh, LocalTransform, Texture, Transform, Renderable};
use amethyst::gfx_device::DisplayConfig;
You can’t perform that action at this time.