Skip to content

Instantly share code, notes, and snippets.

View thai-ng's full-sized avatar

Thai Nguyen thai-ng

View GitHub Profile
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
namespace NetCoreConsolePlayground
{
class Entity
{
public Vector3 Postion;
public Quaternion Rotation;
@thai-ng
thai-ng / api.tsx
Created March 6, 2018 03:19
template typescript
import * as React from 'react';
import './App.css';
const baseURL = 'http://www.sfu.ca/bin/wcm/course-outlines';
interface MyProps {}
interface Data {
text: string;
value: number;
<!DOCTYPE html>
<html>
<head>
<title>Typewriter Monkeys Feedback</title>
</head>
<body>
<h1>Feedback plx</h1>
<form action="forms.php" method="POST">
<label for="ID">Student ID:</label>
<input type="text" autofocus required name="ID" />
#include <opencv2/core.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/opencv.hpp>
#include <array>
#include <string_view>
#include <utility>
using namespace std::string_view_literals;
#include <vector>
#include <iostream>
#include <memory>
#include <algorithm>
#include <type_traits>
using namespace std;
class EventHandler
{
#include <cstdio>
#include <type_traits>
using namespace Platform;
void doTheThing(const wchar_t* string)
{
printf("%ws\n", string);
}
#include <cstdio>
using namespace Platform;
void doTheThing(const wchar_t* string)
{
printf("%ws\n", string);
}
template <typename T>
CXX=emcc
all: test.html
test.html:
$(CXX) -std=c++1z -stdlib=libc++ -O3 *.cpp -o $@ --preload-file test.simp --preload-file teapot.obj -s ALLOW_MEMORY_GROWTH=1
#include <SDL/SDL.h>
#include <emscripten.h>
#include "SDLDrawable.hpp"
#include "client.h"
int main()
{
SDLDrawable drawable(750, 750);
Client client(&drawable, "test.simp");
#include "SDLDrawable.hpp"
SDLDrawable::SDLDrawable(int w, int h) : width(w), height(h)
{
SDL_Init(SDL_INIT_VIDEO);
screen = SDL_SetVideoMode(width, height, 32, SDL_SWSURFACE);
if (SDL_MUSTLOCK(screen))
SDL_LockSurface(screen);
}