Skip to content

Instantly share code, notes, and snippets.

View edp1096's full-sized avatar

Robert Sung-wook Shin edp1096

View GitHub Profile
@edp1096
edp1096 / ! CUDA & OpenCL Intro
Created May 27, 2023 04:51 — forked from yohanesgultom/! CUDA & OpenCL Intro
Simple CUDA and OpenCL code
Simple CUDA and OpenCL code
Compilation:
* CUDA (*.cu): nvcc filename.cu
* CUDA + CUBLAS (*.cu): nvcc filename.cu -lcublas
* OpenCL (*.c): gcc filename.c -lOpenCL
@edp1096
edp1096 / Vector2D.js
Created January 21, 2022 15:27
JavaScript 2D Vector Class
/*
Simple 2D JavaScript Vector Class
Hacked from evanw's lightgl.js
https://github.com/evanw/lightgl.js/blob/master/src/vector.js
*/
function Vector(x, y) {
@edp1096
edp1096 / 00_README.md
Created December 24, 2021 20:53 — forked from reagent/00_README.md
Custom HTTP Routing in Go

Custom HTTP Routing in Go

Basic Routing

Responding to requests via simple route matching is built in to Go's net/http standard library package. Just register the path prefixes and callbacks you want invoked and then call the ListenAndServe to have the default request handler invoked on each request. For example:

package main

import (
@edp1096
edp1096 / main.go
Created September 26, 2019 07:41 — forked from enricofoltran/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@edp1096
edp1096 / index.html
Created August 25, 2018 04:20 — forked from tmichel/index.html
simple websocket example with golang
<html>
<head>
<title>WebSocket demo</title>
</head>
<body>
<div>
<form>
<label for="numberfield">Number</label>
<input type="text" id="numberfield" placeholder="12"/><br />
@edp1096
edp1096 / json.go
Created August 4, 2018 16:26 — forked from chuprik/json.go
golang, echo, application/json request
package utils
import (
"encoding/json"
"io/ioutil"
"github.com/labstack/echo"
)
func BodyToJson(c echo.Context) (map[string]interface{}, error) {
@edp1096
edp1096 / tidb_win_build.cmd
Last active December 28, 2020 23:22 — forked from tupunco/tidb_win_build.bat
tidb build for windows
rem tidb build in pcbangstudio project folder - http://enjoytools.net/xe/board_vngc57/8978
rem go get tidb
go get -v github.com/pingcap/tidb
rem build goyacc
go build -v -o bin/goyacc.exe src/github.com/pingcap/tidb/parser/goyacc/main.go
rem then below error message will be shown. Just go on.
rem can't load package: package github.com/pingcap/tidb: no Go files in blahblah_directory
@edp1096
edp1096 / androser.py
Created June 14, 2017 07:53 — forked from kaanaksit/androser.py
Serial communication using pyjnius, Arduino Nano and USB-OTG
#!/usr/bin/python
# -*- coding: utf-8 -*-
__author__ = ('Kaan Akşit')
try:
import sys,time
from array import array
from jnius import autoclass
from jnius import cast
@edp1096
edp1096 / kivy-serialdata.py
Created June 14, 2017 06:00 — forked from openp2pdesign/kivy-serialdata.py
Drawing serial data with Kivy (Python)
# -*- coding: utf8 -*-
from kivy.app import App
from kivy.uix.floatlayout import FloatLayout
from kivy.graphics import Line
from kivy.uix.label import Label
from kivy.core.window import Window
from kivy.clock import Clock
import serial
@edp1096
edp1096 / user.js
Created June 1, 2017 18:36 — forked from EtienneR/user.js
XMLHttpRequest RESTful (GET, POST, PUT, DELETE)
// Get all users
var url = "http://localhost:8080/api/v1/users";
var xhr = new XMLHttpRequest()
xhr.open('GET', url, true)
xhr.onload = function () {
var users = JSON.parse(xhr.responseText);
if (xhr.readyState == 4 && xhr.status == "200") {
console.table(users);
} else {
console.error(users);