lat:35.67679460, lng:139.73726860から1000メートル以内のresultを取得するクエリ
SELECT * FROM place WHERE st_distance_sphere(POINT(139.73726860,35.67679460),POINT(lng,lat)) <= 1000
| これからJulesを利用して、CLIアプリケーションを開発してもらうのですが、Julesに渡すプロンプトを作成してほしいです。必要な事項を質問してくれたら答えていくので、結果をmarkdown形式でまとめてください。 | |
| --- | |
| # CLIアプリケーション開発プロンプト | |
| **アプリケーション名:** (仮) VersionManager | |
| **目的:** ユーザー自身がインストールしたアプリケーションのバージョン情報を一元的に管理し、最新バージョンの確認などを容易にするCLIツール。 |
| class CancellablePromiseCancelled {} | |
| function cancellableTimeout(delay, func = () => {}) { | |
| let timeoutID = null | |
| let rejectPromise = () => {} | |
| const exec = new Promise((resolve, reject) => { | |
| timeoutID = setTimeout(async () => { | |
| timeoutID = null | |
| await func() |
| // js版はこっち https://www.geodatasource.com/developers/javascript | |
| double _distanceBetween( | |
| double startLatitude, | |
| double startLongitude, | |
| double endLatitude, | |
| double endLongitude, | |
| ) { | |
| var earthRadius = 6378137.0; | |
| var dLat = _toRadians(endLatitude - startLatitude); |
lat:35.67679460, lng:139.73726860から1000メートル以内のresultを取得するクエリ
SELECT * FROM place WHERE st_distance_sphere(POINT(139.73726860,35.67679460),POINT(lng,lat)) <= 1000
| const isValidHex = (hex) => /^#([A-Fa-f0-9]{3,4}){1,2}$/.test(hex) | |
| const getChunksFromString = (st, chunkSize) => st.match(new RegExp(`.{${chunkSize}}`, "g")) | |
| const convertHexUnitTo256 = (hexStr) => parseInt(hexStr.repeat(2 / hexStr.length), 16) | |
| const getAlphafloat = (a, alpha) => { | |
| if (typeof a !== "undefined") {return a / 255} | |
| if ((typeof alpha != "number") || alpha <0 || alpha >1){ | |
| return 1 |
CodePen: https://codepen.io/renoinn/pen/abNvJZr
参考記事: https://css-tricks.com/aspect-ratio-boxes/
paddingにパーセント指定する場合、widthを基準にするので、それを利用することでアスペクト比を保ったboxを作る。
| const config = { | |
| suffix: '/index.html', | |
| appendToDirs: 'index.html', | |
| } | |
| const regexSuffixless = /\/[^/.]+$/ // e.g. "/some/page" but not "/", "/some/" or "/some.jpg" | |
| const regexTrailingSlash = /.+\/$/ // e.g. "/some/" or "/some/page/" but not root "/" | |
| exports.handler = function handler (event, context, callback) { | |
| const {request} = event.Records[0].cf |
| const links = document.querySelectorAll('a[href^="#"]') | |
| for ( let i = 0; i < links.length; i++ ) { | |
| links[i].addEventListener('click', (e) => { | |
| e.preventDefault(); | |
| const target = document.querySelector(links[i].href.substr(links[i].href.indexOf('#'))) | |
| const elemY = target.getBoundingClientRect().top | |
| const scrollY = window.pageYOffset | |
| const top = Math.abs(elemY + scrollY) |
| const StripeUrl = 'https://js.stripe.com' | |
| /* usage | |
| * | |
| * async mountCard() { | |
| * const stripe = await loadStripe(pk) | |
| * const elements = stripe.elements() | |
| * const card = elements.create('card') | |
| * card.mount('#card-element') | |
| * } |
| import 'dart:async'; | |
| import 'package:flutter/material.dart'; | |
| import 'package:google_maps_flutter/google_maps_flutter.dart'; | |
| import 'package:provider/provider.dart'; | |
| const double DEFAULT_ZOOM = 12.0; | |
| const CameraPosition DEFAULT_CAMERA_POSITION = CameraPosition( | |
| target: LatLng(35.6812405, 139.7649361), | |
| zoom: DEFAULT_ZOOM, |