This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
class PersistentDraggableBottomWidget extends StatefulWidget { | |
PersistentDraggableBottomWidget() : super(); | |
@override | |
_PersistentDraggableBottomWidgetState createState() => _PersistentDraggableBottomWidgetState(); | |
} | |
class _PersistentDraggableBottomWidgetState extends State<PersistentDraggableBottomWidget> { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const connection = require('tp-link-tapo-connect') | |
const run = async (email, password, ip, action) => { | |
const cloudToken = await connection.cloudLogin(email, password) | |
const devices = await connection.listDevicesByType(cloudToken, 'SMART.TAPOPLUG') | |
const deviceToken = ip | |
? await connection.loginDeviceByIp(email, password, ip) | |
: await connection.loginDevice(email, password, devices[0]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import time | |
import numpy as np | |
import asyncio | |
width, height = 640, 480 | |
cap = cv2.VideoCapture("rtsp://usr:pwd@localhost:554") | |
cap.set(3, width) | |
cap.set(4, height) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.7" | |
services: | |
traefik: | |
image: traefik:v2.4 | |
container_name: traefik | |
ports: | |
- 80:80 | |
- 443:443 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Source: https://dev.to/lucis/how-to-push-files-programatically-to-a-repository-using-octokit-with-typescript-1nj0 | |
const { Octokit } = require('@octokit/rest') | |
const glob = require('globby') | |
const path = require('path') | |
const { readFile } = require('fs-extra') | |
// org or owner | |
const ORGANIZATION = process.env.ORGANIZATION |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const json = { | |
'key1': 'value1', | |
'key2': 'value2', | |
} | |
const lodash = require('lodash') | |
const result = lodash.reduce(json, (obj, v, k) => { | |
obj[k] = { | |
message: v, |