Skip to content

Instantly share code, notes, and snippets.

@anoochit
anoochit / main.dart
Created Dec 2, 2020
card view with clip behavior
View main.dart
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
@anoochit
anoochit / payload_fanpop_response_to_line.txt
Last active Aug 16, 2020
payload_fanpop_response_to_line_server
View payload_fanpop_response_to_line.txt
//--- intent fanpop ---//
[{"type":"text","text":"พบข้อมูล 198 รายการ"},{"type":"template","altText":"this is a confirm template","template":{"type":"confirm","actions":[{"type":"postback","label":"ใช่","data":"action=show_fanpop_page&page=1&total=198"},{"type":"message","label":"ไม่ใช่","text":"เปลี่ยนการค้นหาใหม่"}],"text":"ต้องการแสดงข้อมูล"}}]
//--- result fanpop ---//
[
{"type":"flex","altText":"Flex Message","contents":{"type":"carousel","contents":[{"type":"bubble","direction":"ltr","hero":{"type":"image","url":"https://finfin.vip/sites/default/files/styles/large/public/photo/yiiiwahh/5D57898C-13E0-4F98-ACFF-49D250A39C5D.jpeg","size":"full","aspectRatio":"1:1","aspectMode":"cover"},"body":{"type":"box","layout":"vertical","contents":[{"type":"text","text":"yiiiwahh","size":"xxl","align":"center"},{"type":"text","text":"หญิง, 22 ปี","size":"lg","align":"center"},{"type":"text","text":"1400 บาท","size":"xl","align":"center"}]},"footer":{"type":"box","layout":"vertical","contents":[{"type":"button","ac
@anoochit
anoochit / Dockerfile
Created Jun 16, 2020
Dockerfile to build dart container in small image **ONLY** x86_64 arch
View Dockerfile
FROM google/dart AS dart-runtime
WORKDIR /app
ADD pubspec.* /app/
RUN pub get
ADD bin /app/bin/
RUN pub get --offline
RUN dart2native /app/bin/server.dart -o /app/server
View main.dart
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:pawat/generated/l10n.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@anoochit
anoochit / .htaccess
Created Apr 8, 2020
.htaccess woocommerce rest api
View .htaccess
# BEGIN WordPress
# The directives (lines) between `BEGIN WordPress` and `END WordPress` are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
View add-document-to-firestore.js
admin
.firestore()
.collection("products")
.add({
name: "BrowserTestProduct26",
createdAt: Date.now(),
createdBy: admin.firestore().doc(`profiles/${userRecord.uid}`),
isDeleted: false,
category: categories[Math.floor(Math.random() * categories.length)]
})
View heapster-influxdb-grafana.yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: monitoring-influxdb
namespace: kube-system
spec:
replicas: 1
template:
metadata:
labels:
View k8s-dashboard-admin-user.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: admin-user
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: admin-user
View devstack-cheat-sheet.txt
sudo useradd -s /bin/bash -d /opt/stack -m stack
echo "stack ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/stack
sudo su - stack
git clone https://git.openstack.org/openstack-dev/devstack
cd devstack
@anoochit
anoochit / Dockerfile
Created Jun 15, 2019
deviceQuery Dockerfile for container app in NVIDIA Jetson Nano
View Dockerfile
FROM arm64v8/ubuntu
ENV LD_LIBRARY_PATH=/usr/lib/aarch64-linux-gnu/tegra
RUN mkdir /cudaSamples
COPY deviceQuery /cudaSamples/
CMD /cudaSamples/deviceQuery