Skip to content

Instantly share code, notes, and snippets.

View Mirochiu's full-sized avatar

Chiu, Yung-Hsiang Mirochiu

View GitHub Profile
@Mirochiu
Mirochiu / genkeystore.sh
Created March 31, 2023 02:53
Use pk8 and x509.pem files in AOSP to generate the keystore file for Android Studio
#!/usr/bin/bash
# generate the keystore and show the result
storepassword="password"
outkeystore="mygen.keystore"
if [ $# -gt 0 ]; then
outkeystore="$1"
fi
if [ $# -gt 1 ]; then
@Mirochiu
Mirochiu / upload-to-imgur.html
Created March 10, 2023 07:38
upload image to Imgur with Client ID
<!DOCTYPE html>
<html lang="zh-Hant-TW">
<head>
<meta charset="UTF-8">
<script src="http://code.jquery.com/jquery.min.js"></script>
</head>
<body>
<input id="imgurClientId" type="text">
<!DOCTYPE html>
<html lang="zh-Hant-TW">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.datatables.net/1.11.3/css/jquery.dataTables.min.css" rel="stylesheet" />
</head>
<body>
@Mirochiu
Mirochiu / index.js
Created March 15, 2022 03:40
Access Google calendar API with node.js
const { google } = require('googleapis');
const dotenv = require('dotenv');
dotenv.config();
const auth = new google.auth.GoogleAuth({
//keyFile: './client_secret.json', // GOOGLE_APPLICATION_CREDENTIALS
scopes: [
'https://www.googleapis.com/auth/calendar',
'https://www.googleapis.com/auth/calendar.events',
],
@Mirochiu
Mirochiu / index.js
Created October 21, 2021 01:34
express sample code for uploading files
const express = require('express');
const bodyParser = require('body-parser');
const app = express();
const crypto = require('crypto');
const multer = require('multer');
const upload = multer();
app.use(bodyParser.urlencoded({ extended: true }));
// app.use(express.urlencoded()); // deprecated
@Mirochiu
Mirochiu / simple_upload.html
Last active October 19, 2021 03:18
sample to upload html file in appscript
<!DOCTYPE html>
<html lang="zh-Hant-TW">
<head><base target="_top"><meta charset="UTF-8"></head>
<body>
<h1>上傳HTML檔案</h1>
<form id="upload_form" onsubmit="onSubmit(event)">
<label for="html_name">網頁名稱</label>
<input id="html_name" type="text" name="the-name" required />
<br />
<label for="file_chooser">請選檔案</label>
@Mirochiu
Mirochiu / adb-completion.bash
Last active September 17, 2021 01:38 — forked from otobrglez/adb-completion.bash
feat: handle the logcat subcommand
# /* vim: set ai ts=4 ft=sh: */
#
# Copyright 2011, The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@Mirochiu
Mirochiu / build-gnutls-static-library.sh
Created September 3, 2021 06:19
build gnutls for ffmpeg 4.4
echo "install uncompress utils"
sudo apt install xz-utils lzip
echo "download source codes"
wget -c https://www.gnupg.org/ftp/gcrypt/gnutls/v3.6/gnutls-3.6.16.tar.xz -O - | tar -xJ
wget -c https://ftp.gnu.org/gnu/nettle/nettle-3.4.1.tar.gz -O - | tar -xz
wget -c https://gmplib.org/download/gmp/gmp-6.2.1.tar.lz -O - | tar --lzip -x
wget -c http://ftp.gnu.org/gnu/libtasn1/libtasn1-4.9.tar.gz -O - | tar -xz
wget -c https://ftp.gnu.org/gnu/libunistring/libunistring-0.9.10.tar.xz -O - | tar -xJ
wget -c https://github.com/libffi/libffi/archive/refs/tags/v3.0.9.tar.gz -O - | tar -xz
@Mirochiu
Mirochiu / fix_run_monkeyrunner .txt
Created December 11, 2020 02:35
fix monkeyrunner not run in windows command prompt
Assume that the android sdk path in your windows system is C:\Users\%USERNAME%\AppData\Local\Android\Sdk
1. fix monkeyrunner not found
add below directory to your system path
C:\Users\%USERNAME%\AppData\Local\Android\Sdk\tools\bin
2. fix SWT folder not found
@Mirochiu
Mirochiu / main.yml
Created December 10, 2020 02:18
gihub action yml file for building react-native android app
name: build-react-native-android-app
on:
push:
tags:
- 'v*rel*'
jobs:
build:
runs-on: ubuntu-16.04