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 / LZ4 공부.c
Last active April 19, 2017 17:24
A simple example code using LZ4.
/*
* LZ4 Study.
* (c) Robert Sung wook Shin All rights reserved.
* http://enjoytools.net, edp1096@naver.com
*
*/
#include "stdafx.h" // empty except '#pragma once'
#include <stdio.h>
@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);
# -*- coding: utf-8 -*-
import sys
import threading
import queue
# from kivy.compat import queue
import serial
import time
import kivy
kivy.require('1.9.0')
@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 / 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 / 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 / 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 / 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 />
REM tap+bridge cause blue screen
REM https://wiki.qemu.org/Documentation/Networking
REM using tap
REM start qemu-system-x86_64w.exe -vga std -nic tap,id=n0,ifname=tap0,script=no,downscript=no -boot c -m 2G -hda images/freebsd-11.3.qcow2 -smp sockets=1,cores=2
REM not using tap
start qemu-system-x86_64w.exe -vga std -device rtl8139,netdev=n0 -netdev user,id=n0,hostfwd=tcp::2222-:22,hostfwd=tcp::8080-:80 -boot c -m 2G -hda images/freebsd-11.3.qcow2 -smp sockets=1,cores=2
@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"