Skip to content

Instantly share code, notes, and snippets.

View mikkipastel's full-sized avatar

Monthira Chayabanjonglerd mikkipastel

View GitHub Profile
@mikkipastel
mikkipastel / post.hbs
Created April 20, 2024 09:56
add table of content to liebling
{{!--
This template is used for the post page.
--}}
{{!-- This block preloads specific assets for the post page --}}
{{#contentFor "preload"}}
<link rel="preload" href="{{asset "css/post.css"}}" as="style" />
<link rel="preload" href="{{asset "js/post.js"}}" as="script" />
{{/contentFor}}
@mikkipastel
mikkipastel / default.hbs
Created April 20, 2024 09:55
add table of content to liebling
<!DOCTYPE html>
<html lang="{{@site.locale}}">
<head>
{{!-- Document Settings --}}
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
{{!-- Base Meta --}}
<title>{{meta_title}}</title>
<meta name="HandheldFriendly" content="True" />
@mikkipastel
mikkipastel / calculate_screen_score.yml
Last active February 26, 2024 14:01
test github action for run paparazi and calculate point
name: calculate screen score with compose battle 2024
on: [push]
jobs:
build-debug:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: set up JDK 17
@mikkipastel
mikkipastel / index.js
Last active November 6, 2023 14:32
DevFest BKK 2023: Build a Generative AI Chatbot with PaLM API and Cloud Functions for Firebase 2nd Gen
const { onRequest } = require("firebase-functions/v2/https");
const { onDocumentUpdated} = require("firebase-functions/v2/firestore");
const { getFirestore } = require('firebase-admin/firestore');
const { initializelpp } = require('firebase-admin/app");
initializeApp();
const axios = require("axios");
exports.webhook onRequest(async (req, res) {
const events req.body.events;
@mikkipastel
mikkipastel / index.js
Last active October 1, 2023 07:04
note code for LON in LCT23 / not correct at all
const { onRequest } = require('firebase-function/v2/https');
const { getFirestore, FieldValue = require('firebase-admin/firestore');
const { initializeApp) = require('firebase-admin/app');
initializeApp();
// 1. import module
const LINE = require(‘./line’);
const TEMPLETE = require(‘./template’);
exports.send = onRequest(async (req, res) => {
@mikkipastel
mikkipastel / index.html
Created July 28, 2023 06:11
position sizing calculator front-end
<!DOCTYPE html>
<html lang="en">
<head>
<title>Position Sizing Calculator</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- OpenGraph/Social sharing -->
<meta name="description" content="Calculator for trade cryptocurrency future, formular from Crypto Teller" />
@mikkipastel
mikkipastel / MainActivity.kt
Created January 16, 2023 15:13
LazyColumn with Jetpack Compose (LazyListScope)
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val names = listOf("Stocker DAO", "Bittoon DAO", "Apetimism", "LonelyPop")
setContent {
MyTheme {
// A surface container using the 'background' color from the theme
Surface(
modifier = Modifier.fillMaxSize(),
color = MaterialTheme.colors.surface
@mikkipastel
mikkipastel / MainActivity.kt
Last active January 16, 2023 15:13
LazyColumn with Jetpack Compose (forEach + LazyListScope.item)
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val names = listOf("Stocker DAO", "Bittoon DAO", "Apetimism", "LonelyPop")
setContent {
MyTheme {
// A surface container using the 'background' color from the theme
Surface(
modifier = Modifier.fillMaxSize(),
color = MaterialTheme.colors.surface
@mikkipastel
mikkipastel / device_list.txt
Created January 12, 2023 08:55
Android Device List in Firebase Test Lab [12-01-2023] from `gcloud firebase test android models list`
┌─────────────────────┬────────────────────┬──────────────────────────────────────────┬──────────┬─────────────┬─────────────────────────┬──────────────────┐
│ MODEL_ID │ MAKE │ MODEL_NAME │ FORM │ RESOLUTION │ OS_VERSION_IDS │ TAGS │
├─────────────────────┼────────────────────┼──────────────────────────────────────────┼──────────┼─────────────┼─────────────────────────┼──────────────────┤
│ 1610 │ Vivo │ vivo 1610 │ PHYSICAL │ 1280 x 720 │ 23 │ │
│ ASUS_X00T_3 │ Asus │ ASUS_X00TD │ PHYSICAL │ 1080 x 2160 │ 27,28 │ │
│ AmatiTvEmulator │ Google │ Google TV Amati │ VIRTUAL │ 1080 x 1920 │ 29 │ beta=29 │
│ AndroidTablet270dpi │ Generic │ Generic 720x1600 Android tablet
@mikkipastel
mikkipastel / MainFragment.kt
Last active October 6, 2022 09:17
add second fragment
package com.ascedncorp.androidbasic
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import com.ascedncorp.androidbasic.databinding.FragmentMainBinding
class MainFragment: Fragment() {