Skip to content

Instantly share code, notes, and snippets.

View dulimarta's full-sized avatar

Hans Dulimarta dulimarta

  • School of Computing and Information Systems, Grand Valley State University
  • Grand Rapids, Michigan
View GitHub Profile
@dulimarta
dulimarta / render.js
Last active January 17, 2017 21:53
CS367 HW01 render.js
function main() {
let canvas = document.getElementById("my-canvas");
// setupWebGL is defined in webgl-utils.js, it returns a WebGLRenderingContext
let gl = WebGLUtils.setupWebGL(canvas);
// Load the shader pair. 2nd arg is vertex shader, 3rd arg is fragment shader
ShaderUtils.loadFromFile(gl, "vshader.glsl", "fshader.glsl")
.then( (prog) => { //
// Use black RGB=(0,0,0) for the clear color
@dulimarta
dulimarta / render.js
Last active January 11, 2018 01:15
CS367 HW01 render.js
var gl;
function main() {
let canvas = document.getElementById("my-canvas");
// setupWebGL is defined in webgl-utils.js, it returns a WebGLRenderingContext
gl = WebGLUtils.setupWebGL(canvas);
// Load the shader pair. 2nd arg is vertex shader, 3rd arg is fragment shader
ShaderUtils.loadFromFile(gl, "vshader.glsl", "fshader.glsl")
.then(drawIt);
@dulimarta
dulimarta / render.js
Created January 17, 2017 18:47
CS367 HW01 render.js
function main() {
let canvas = document.getElementById("my-canvas");
// setupWebGL is defined in webgl-utils.js
let gl = WebGLUtils.setupWebGL(canvas);
// Use black RGB=(0,0,0) for the clear color
gl.clearColor(0.0, 0.0, 0.0, 1.0);
// clear the color buffer
@dulimarta
dulimarta / index.html
Last active January 17, 2017 18:41
CS367 HW01 index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<script type="text/javascript" src="webgl-utils.js"></script>
<script type="text/javascript" src="render.js"></script>
<title>My First WebGL</title>
</head>
<body onload="main()">
<p>Hello World!</p>
@dulimarta
dulimarta / lab14_b.c
Created April 21, 2016 03:12
CS452 Lab15 - Sample 2
#include <stdio.h>
#include <stdlib.h>
int main () {
char command[80] = "date +%A";
char name[32];
printf ("Enter your nickname: ");
gets (name);
printf ("Hi, %s. Today is: ", name);
@dulimarta
dulimarta / lab14_b.c
Created April 21, 2016 02:09
CS452 Lab15 - Sample 2
#include <stdio.h>
#include <stdlib.h>
int main () {
char command[80] = "date +%A";
char name[32];
printf ("Enter your nickname: ");
gets (name);
printf ("Hi, %s. Today is: ", name);
@dulimarta
dulimarta / lab14_a.c
Created April 20, 2016 23:50
CS452 Lab14 - Sample 1
#include <stdio.h>
#include <stdlib.h>
int main () {
char name[80];
char command[80];
printf ("Enter your eos username: ");
scanf ("%s", name);
sprintf (command, "groups %s", name);
@dulimarta
dulimarta / lab13_a.c
Created April 13, 2016 21:00
CS452 Lab13 - Sample 1
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/types.h>
#include <unistd.h>
#include <errno.h>
#define SIZE 30
int main (int argc, char *argv[]) {
@dulimarta
dulimarta / lab12_b.c
Last active April 1, 2020 17:03
CS452 Lab12 - Sample 2
#include <stdio.h>
#include <dirent.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <errno.h>
int main()
{
DIR *dirPtr;
struct dirent *entryPtr;
@dulimarta
dulimarta / lab12_a.c
Last active December 2, 2021 01:34
CS452 Lab12 - Sample 1
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <errno.h>
int main(int argc, char *argv[])
{
struct stat statBuf;