Skip to content

Instantly share code, notes, and snippets.

View keoy7am's full-sized avatar
🏠
Work at home

Elliot Chen keoy7am

🏠
Work at home
  • Taipei,Taiwan
  • 20:14 (UTC +08:00)
View GitHub Profile
@keoy7am
keoy7am / autocc.py
Last active April 24, 2023 05:07
基於OpenCC的全資料夾自動翻譯python腳本
# coding: utf-8
import os
####################################################
# 若 src_folder == dst_folder 則會直接將原始檔案覆蓋 #
# 需注意是否有程式(如:vsc)在使用原始檔案,若有,請先關閉 #
####################################################
src_folder = "I:\git\Repo"
dst_folder = "I:\git\Repo"
@keoy7am
keoy7am / note.md
Last active September 12, 2022 00:53

找回Win10消失的命令提示元快捷

為了避免每次環境調整都要手動找一次
乾脆記錄在 gist

shift_cmd.reg

與PowerShell一樣在 Background\shell 下
原本的 命令提示元 替換成 PowerShell 後其機碼還是保留的
但需將 cmd 的 HideBasedOnVelocityId 改為 ShowBasedOnVelocityId

@keoy7am
keoy7am / nginx.conf
Created October 5, 2021 10:49 — forked from thoop/nginx.conf
Official prerender.io nginx.conf for nginx
# Change YOUR_TOKEN to your prerender token
# Change example.com (server_name) to your website url
# Change /path/to/your/root to the correct value
server {
listen 80;
server_name example.com;
root /path/to/your/root;
index index.html;
@keoy7am
keoy7am / walkthrough
Last active August 9, 2023 20:44
Install Sybase 16.0 SP04 PL01 On Ubuntu ( walkthrough )
1. Update source list and upgrade packages.
> apt-get update -y && apt-get upgrade -y
( Set timezone )
> timedatectl set-timezone Asia/Taipei
( Choose en_US.UTF8 )
> dpkg-reconfigure locales
* If you don't set locales to en_US.UTF8, it will show some errors when querying.
@keoy7am
keoy7am / gist:e97235d750707b715b0c6df9fcda4e03
Created October 4, 2021 23:05
Nginx Log Rotate On Windows
echo Restarting Nginx
echo off
:: 參數設定 ::
set "NginxDir=C:\Users\Srv\Desktop\nginx"
set "LogDir=%NginxDir%\logs"
:: 整理Log Start ::
:: 退出Nginx
= How to install SAP ASE 16.0 SP03 for Linux
1. Download product binally
Download product binally(ASE_Suite.linuxamd64.tgz) from below url instruction:
https://help.sap.com/viewer/23c3bb4a29be443ea887fa10871a30f8/16.0.3.8/en-US/c14592e2df414678b3620e75ccbc0248.html
2. Install
```
mkdir ~/tmp
mv ASE_Suite.linuxamd64.tgz ~/tmp
git --version
yum info git
yum remove git
yum -y install https://packages.endpoint.com/rhel/7/os/x86_64/endpoint-repo-1.7-1.x86_64.rpm
yum install git
git --version
@keoy7am
keoy7am / Index.cshtml
Created March 6, 2021 22:12 — forked from vanillajonathan/Index.cshtml
TinyMCE image upload on ASP.NET MVC
<script src="//tinymce.cachefly.net/4.2/tinymce.min.js"></script>
<script>
tinymce.init({
selector: 'textarea',
images_upload_url: "TinyMceUpload",
});
function upload(form) {
tinymce.activeEditor.uploadImages(function (success) {
form.submit();
@keoy7am
keoy7am / blazor-auth.md
Created February 22, 2021 03:27 — forked from SteveSandersonMS/blazor-auth.md
Blazor authentication and authorization

Authentication and Authorization

Authentication means determining who a particular user is. Authorization means applying rules about what they can do. Blazor contains features for handling both aspects of this.

It worth remembering how the overall goals differ between server-side Blazor and client-side Blazor:

  • Server-side Blazor applications run on the server. As such, correctly-implemented authorization checks are both how you determine which UI options to show (e.g., which menu entries are available to a certain user) and where you actually enforce access rules.
  • Client-side Blazor applications run on the client. As such, authorization is only used as a way of determining what UI options to show (e.g., which menu entries). The actual enforcement of authorization rules must be implemented on whatever backend server your application operates on, since any client-side checks can be modified or bypassed.

Authentication-enabled templates for Server-Side Blazor

# ref:https://stackoverflow.com/questions/750172/how-to-change-the-author-and-committer-name-and-e-mail-of-multiple-commits-in-gi
git filter-branch --env-filter '
OLD_EMAIL="root@babala"
CORRECT_NAME="keoy7am"
CORRECT_EMAIL="keoy7am@gmail.com"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_COMMITTER_NAME="$CORRECT_NAME"