Skip to content

Instantly share code, notes, and snippets.

View williamsiuhang's full-sized avatar

William Siuhang williamsiuhang

View GitHub Profile
@williamsiuhang
williamsiuhang / async-fetch
Last active April 1, 2019 00:24
async-fetch
// Basic GET request using fetch API
async function GET() {
try{
var url = "http://domain.com/route/api/endpoint";
var get = await fetch(url);
var val = await get.text();
console.log(val);
}catch(e){
class Shaders{
static basic_vertex() {
return `
void main() {
gl_Position = projectionMatrix * modelViewMatrix * vec4(position,1.0);
}
`;
}
static basic_fragment() {