Skip to content

Instantly share code, notes, and snippets.

View yychen's full-sized avatar

Tom Chen yychen

View GitHub Profile
@yychen
yychen / server.js
Last active March 26, 2024 14:45
Sample LINE Bot
// Based on https://line.github.io/line-bot-sdk-nodejs/getting-started/basic-usage.html#synopsis
// 做了一些修改讓同學們比較好理解
const express = require('express')
const line = require('@line/bot-sdk');
const app = express()
const port = 3000
const config = {
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
const readline = require('readline')
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
})
function question(query) {
return new Promise((resolve) => {
rl.question(query, (answer) => {
#!/usr/bin/env python3
import socket
UDP_IP = "127.0.0.1"
UDP_PORT = 3838
# MESSAGE = "\nter 0.78\nmaster 0.4\nmaster 0.5"
MESSAGE = "This is a test....\n\n"
print("UDP target IP:", UDP_IP)
print("UDP target port:", UDP_PORT)
#!/usr/bin/env python3
import socket
import time
UDP_HOST = '0.0.0.0'
UDP_PORT = 3838
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.bind((UDP_HOST, UDP_PORT))
@yychen
yychen / bgm.cs
Created September 26, 2018 10:30
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Linq;
public class BGMBridge : BridgeBase
{
public BGMManager manager;
@yychen
yychen / Mayor.cs
Created September 24, 2018 11:35
Mayor.cs
using System;
using System.Collections;
using System.Linq;
using System.Collections.Generic;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using UnityEngine;
using UnityEngine.Networking;
using RSG;
@yychen
yychen / APIService.cs
Last active September 24, 2018 11:33
APIService.cs
using System;
using System.Collections;
using System.Collections.Generic;
using RSG;
using UnityEngine;
using UnityEngine.Networking;
public class RequestException : Exception {
public UnityWebRequest Request { get; set; }
# $Id: screen-keys.conf,v 1.7 2010-07-31 11:39:13 nicm Exp $
#
# By Nicholas Marriott. Public domain.
#
# This configuration file binds many of the common GNU screen key bindings to
# appropriate tmux key bindings. Note that for some key bindings there is no
# tmux analogue and also that this set omits binding some commands available in
# tmux but not in screen.
#
# Note this is only a selection of key bindings and they are in addition to the
# $Id: screen-keys.conf,v 1.7 2010-07-31 11:39:13 nicm Exp $
#
# By Nicholas Marriott. Public domain.
#
# This configuration file binds many of the common GNU screen key bindings to
# appropriate tmux key bindings. Note that for some key bindings there is no
# tmux analogue and also that this set omits binding some commands available in
# tmux but not in screen.
#
# Note this is only a selection of key bindings and they are in addition to the