Skip to content

Instantly share code, notes, and snippets.

@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 / simsons-ko.html
Last active December 4, 2021 21:02
Knockout.js Taste
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Knockout.js 테스트</title>
<script src="http://cdnjs.cloudflare.com/ajax/libs/knockout/3.5.0/knockout-min.js"></script>
</head>
@edp1096
edp1096 / si-prefix-conversion.go
Created April 20, 2021 20:21
SI prefix conversion
package main
import (
"fmt"
"math"
)
type Ranges struct {
Divider float64
Suffix string
# Mainsail update script
## Klipper
#cd ~/klipper
#git fetch
#git checkout origin/master
#sudo service klipper restart
@edp1096
edp1096 / hello-regexp.go
Last active July 28, 2020 06:09
golang 정규표현식 연습
package main // import "hello-regexp"
import (
"fmt"
"regexp"
"strings"
)
func main() {
targetText := []string{
@edp1096
edp1096 / eepromSerial.ino
Last active October 14, 2019 04:39
EEPROM R/W 테스트 - 시리얼 통신은 헥사로 쓰고 읽기
/*
sprintf 안 썼으므로, HEX로 터미널 입출력
*/
#include <EEPROM.h>
int addr = -1;
int cmd = 0; // 1: write, 2: read
unsigned char c;
@edp1096
edp1096 / serialSend.c
Last active October 8, 2019 07:14
atmega128 타이머 인터럽트 확인용
#define F_CPU 16000000UL
#define USART_BAUDRATE 9600 // baud rate
#define UBRR_VALUE (((F_CPU / (USART_BAUDRATE * 16UL))) - 1) // Clock, bps to UBRR
#include <avr/io.h>
#include <stdio.h>
#include <util/delay.h>
#include <avr/interrupt.h>
@edp1096
edp1096 / serialEcho.c
Last active October 8, 2019 00:25
atmega128 시리얼 에코 테스트
#define F_CPU 16000000UL
#define USART_BAUDRATE 9600 // baud rate
#define UBRR_VALUE (((F_CPU / (USART_BAUDRATE * 16UL))) - 1) // Clock, bps to UBRR
#include <avr/io.h>
#include <stdio.h>
void initUART()
@edp1096
edp1096 / serialEcho.ino
Created October 5, 2019 18:53
시리얼통신 참고용
unsigned char c;
int led = 44;
void setup() {
pinMode(led, OUTPUT);
Serial1.begin(9600);
}
void loop() {