Skip to content

Instantly share code, notes, and snippets.

View gary9716's full-sized avatar

Kuan-Ting Chou gary9716

  • AIFIAN
View GitHub Profile
@gary9716
gary9716 / EasingFunctions.cs
Created January 5, 2023 02:39 — forked from cjddmut/EasingFunctions.cs
Easing Functions for Unity3D
/*
* Created by C.J. Kimberlin
*
* The MIT License (MIT)
*
* Copyright (c) 2019
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
@gary9716
gary9716 / fugle_update_limit_order.py
Last active December 20, 2022 01:38
update limit order with latest transaction for stock service provider Fugle on Google Cloud
import finlab
import os
os.chdir("/tmp")
from bucket import connect_storage
def loginFugle():
import keyring
from fugle_trade.util import setup_keyring
from configparser import ConfigParser
from fugle_trade.sdk import SDK
using System;
using System.Text;
namespace TestApp
{
class Program
{
private const int secsPerMin = 60;
private const int minsPerHour = 60;
private const int hoursPerDay = 24;
@gary9716
gary9716 / GoogleAPIUtil.cs
Created August 18, 2021 14:02
Some google .net api usage implemented in Unity
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Threading;
using Google.Apis.Auth.OAuth2;
using Google.Apis.Drive.v3;
using Google.Apis.Services;
using Google.Apis.Sheets.v4;
using Google.Apis.Sheets.v4.Data;
@gary9716
gary9716 / ConvertGrayCode.ino
Created August 4, 2021 19:31
Convert gray code signal to corresponding angle for absolute rotary encoder(E6CP-AG5C with resolution 360 degrees) in Arduino
#define PIN_0 (2) //2^0
#define PIN_1 (3) //2^1
#define PIN_2 (4) //2^2
#define PIN_3 (5) //2^3
#define PIN_4 (6) //2^4
#define PIN_5 (7) //2^5
#define PIN_6 (8) //2^6
#define PIN_7 (9) //2^7
#define PIN_8 (10) //2^8
#define TO_INVERT_SIG (1) //In my case, I need to invert the signal to get the correct result.
@gary9716
gary9716 / Dockerfile
Created December 20, 2020 13:24
create environment with miniconda and start with that environment
FROM continuumio/miniconda3
WORKDIR /build-conda
ENV PATH /opt/conda/bin:$PATH
ARG CONDA_ENV="finlab"
ARG PY_RUNTIME="3.7.9"
# Create the environment:
RUN conda create --name ${CONDA_ENV} python=${PY_RUNTIME}
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
[AddComponentMenu("Layout/Messager Layout Group", 150)]
public class MessagerLayoutGroup : HorizontalOrVerticalLayoutGroup
{
public override void CalculateLayoutInputVertical()
@gary9716
gary9716 / DialogSysEditorExtension.cs
Created June 20, 2020 16:27
Dialogue System Editor Extension
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using PixelCrushers.DialogueSystem.DialogueEditor;
using PixelCrushers.DialogueSystem;
using System.Reflection;
public class DialogSysEditorExtension : EditorWindow {
public static Bounds GetBounds4Item(ScrollRect scrollRect, RectTransform rt)
{
var content = scrollRect.content;
if (content == null) return new Bounds();
var viewRect = scrollRect.viewport == null ? (scrollRect.transform as RectTransform) : scrollRect.viewport;
var vMin = new Vector3(float.MaxValue, float.MaxValue, float.MaxValue);
var vMax = new Vector3(float.MinValue, float.MinValue, float.MinValue);
var toLocal = viewRect.worldToLocalMatrix;
@gary9716
gary9716 / 177ComicDownloader.js
Last active February 21, 2020 18:50
放到TamperMonkey載漫畫蠻好用的
// ==UserScript==
// @name 177manga download
// @name:zh-CN 177漫画下载
// @namespace https://greasyfork.org/
// @version 0.1
// @create 2017-04-08
// @description 批量复制下载命令到剪贴板
// @description:zh-CN 批量复制下载命令到剪贴板
// @author k_k_kls
// @reviser KT