Setup:
Samsung Galaxy Tab S5e SM-T720
Android Pie on Linux 4.9.112 (not rooted)
Termux
// Generates canvas drawing commands from an SVG path string | |
import 'package:path_parsing/path_parsing.dart'; | |
void main(List<String> args) { | |
if (args.length < 3) { | |
print('Usage: width height path_string'); | |
return; | |
} |
extern crate websocket; | |
use std::thread; | |
use std::sync::Arc; | |
use std::sync::Mutex; | |
use std::sync::mpsc::{Sender, Receiver}; | |
use std::sync::mpsc; | |
use websocket::Message; | |
use websocket::stream::sync::TcpStream; | |
use websocket::sync::{Server, Client}; |
import 'package:flutter/material.dart'; | |
import 'package:rxdart/rxdart.dart'; | |
// Global application configuration and navigation | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) => MaterialApp(home: Home()); |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<meta name="scaffolded-by" content="https://github.com/google/stagehand" /> | |
<title>webassembly_example</title> | |
<link rel="stylesheet" href="styles.css" /> |
import 'dart:math'; | |
import 'package:flutter/material.dart'; | |
// based on https://github.com/fedeoo/flip_card/ | |
// provides a callback to the front & back widgets so they can trigger the flip, therefore the CardSideBuilder | |
// note this version only flips horizontally | |
class AnimationCard extends StatelessWidget { | |
AnimationCard({this.child, this.animation}); |
// Inspired by https://twitter.com/coderitual/status/1112297299307384833 and https://tapajyoti-bose.medium.com/7-killer-one-liners-in-javascript-33db6798f5bf | |
// Remove any duplicates from an array of primitives. | |
const unique = [...new Set(arr)] | |
// Sleep in async functions. Use: await sleep(2000). | |
const sleep = (ms) => (new Promise(resolve => setTimeout(resolve, ms))); | |
// or | |
const sleep = util.promisify(setTimeout); |
// BLOC | |
class ErrorBloc extends Bloc<ErrorBlocEvent, ErrorBlocState> { | |
@override | |
Stream<ClaimState> mapEventToState(ErrorBlocState currentState, ErrorBlocEvent event) async* { | |
if (event is SomeEvent) { | |
yield Processing(); | |
final result = await _doSomething(); | |
if(result.success) { | |
yield Success(); |
import re | |
import sqlite3 | |
import time | |
import requests | |
DB_PATH = 'wnjpn.db' | |
SWN_PATH = 'SentiWordNet_3.0.0_20130122.txt' | |
URL = 'https://script.google.com/macros/s/Please_write_here/exec?text=%s&source=en&target=ja' | |
RESULT_PATH = 'result.csv' |
package main | |
/* | |
parse json, extract type in json and save to graphql.schema | |
*/ | |
import ( | |
"io/ioutil" | |
"encoding/json" | |
"reflect" | |
"fmt" |