Skip to content

Instantly share code, notes, and snippets.

View jcyh0120's full-sized avatar

jcyh0120

View GitHub Profile
@jcyh0120
jcyh0120 / example1.ts
Created October 29, 2020 06:33
question: typescript for iot device?
export interface LEDStates1 {
LED1: "OFF" | "ON";
}
export interface LEDStates2 {
LED1: "OFF" | "ON";
LED2: "OFF" | "ON";
LED3: "OFF" | "ON";
@jcyh0120
jcyh0120 / Day02 - 金錢遊戲.csv
Last active September 3, 2019 08:37
三十Early副本攻略
專案時間 📅 2011.10
初衷: 🎮 為了讓公會可以更強大
人力成本: 👤👤 一人專案 + (公會成員共同編輯)
時間成本: ⭐️⭐️ 年代久遠,有點難考究,但大概花了一個月吧
金錢成本: ⭐️ 不用錢,使用 Google 雲端硬碟 + Google Sheet
難度規模: ⭐️⭐️ 需要熟悉一下 Excel 類似的巨集和指令
自己的樂趣: ⭐️⭐️⭐️ 和團隊一起努力的感覺真好
對別人的影響: ⭐️⭐️ 大家也覺得這個工具很方便,甚至我自己沒有玩遊戲以後,還有人繼續使用一陣子
學到什麼 🎓 共同編輯的使用情境,就是團隊作戰!
@jcyh0120
jcyh0120 / data-classify-with-time-period.js
Last active November 28, 2018 09:28
資料依據時間區間做分類
const getRandomTime = () => Math.floor(Math.random() * 10000)
const time = Date.now()
const data = [
{ timestamp: time + getRandomTime(), message: 'hello1', user: 'user1' },
{ timestamp: time + getRandomTime(), message: 'hello2', user: 'user2' },
{ timestamp: time + getRandomTime(), message: 'hello3', user: 'user3' },
{ timestamp: time + getRandomTime(), message: 'hello4', user: 'user1' },
{ timestamp: time + getRandomTime(), message: 'hello5', user: 'user2' },
{ timestamp: time + getRandomTime(), message: 'hello6', user: 'user3' },
@jcyh0120
jcyh0120 / 有做檢查.js
Created October 1, 2018 13:26
koa api 該怎麼做檢查啊
export const 創新角色 = async (ctx, next) => {
const { 玩家Id, 角色名稱, 職業, 伺服器 } = ctx.request.body;
if (!玩家Id || !角色名稱 || !職業 || !伺服器) {
return ctx.throw(422);
}
const 伺服器資料 = await ctx
.db("伺服器列表")
.where({ id: 伺服器.id })
@jcyh0120
jcyh0120 / bitbucket-pipelines.yml
Created September 1, 2018 02:17
nodejs app engine bitbucket-pipelines
# This is a sample build configuration for JavaScript.
# Check our guides at https://confluence.atlassian.com/x/14UWN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: node:8.9.4
pipelines:
default:
- step:
@jcyh0120
jcyh0120 / README-Template.md
Created August 31, 2018 02:58 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@jcyh0120
jcyh0120 / gulpfile.js
Created October 26, 2017 02:59
gulp source map with babel, uglifyjs, ngAnnotation.
var gulp = require('gulp');
var gutil = require('gulp-util');
var concat = require('gulp-concat');
var rename = require('gulp-rename');
var replace = require('gulp-replace');
var sh = require('shelljs');
var sourcemaps = require('gulp-sourcemaps');
var babel = require('gulp-babel');
var result = FunA(test)
.then(function(){
return FunB();
}).catch(function(error){
//handle error here???
console.error(error);
});
function FunA(test){
return new Promise(function(resolve,reject){