Before you start
Install packages on your Synology with the Package Manager
- Docker
- Git
blueprint: | |
name: Low battery level detection & notification for all battery sensors | |
description: Regularly test all sensors with 'battery' device-class for crossing | |
a certain battery level threshold and if so execute an action. | |
domain: automation | |
input: | |
threshold: | |
name: Battery warning level threshold | |
description: Battery sensors below threshold are assumed to be low-battery (as | |
well as binary battery sensors with value 'on'). |
class CRC32 { | |
static var table: [UInt32] = { | |
(0...255).map { i -> UInt32 in | |
(0..<8).reduce(UInt32(i), { c, _ in | |
(c % 2 == 0) ? (c >> 1) : (0xEDB88320 ^ (c >> 1)) | |
}) | |
} | |
}() |
const express = require("express"); | |
const expressPlayground = require("graphql-playground-middleware-express") | |
.default; | |
const { ApolloServer, gql, PubSub } = require("apollo-server-express"); | |
const { MongoClient } = require("mongodb"); | |
const { createServer } = require("http"); | |
const path = require("path"); | |
const { authorizeWithGithub, generateFakeUsers, uploadFile } = require("./lib"); | |
const typeDefs = gql` |
import XCTest | |
class UniversialLinktTest: XCTestCase { | |
var app: XCUIApplication! | |
override func setUp() { | |
super.setUp() | |
continueAfterFailure = false | |
app = XCUIApplication() | |
app.launch() |
To enable the rotation of a single view controller used to display the preview of Images/Videos. It is intuitive to allow user to rotate there device and screen changes accordingly, so it feels pleasant. But to achieve this, we need to enable the (almost) all Supported Device orientations.
Ex: `Portrait`, `LandscapeLeft`, `LandscapeRight`.
import MessageQueue from 'react-native/Libraries/BatchedBridge/MessageQueue.js'; | |
const WHITELIST = ['UIManager']; | |
const NOOP = () => { }; | |
let queue = []; | |
let now = 0; | |
export default { | |
start() { | |
MessageQueue.spy(msg => { |
React Native is great product but lacks for stable, intuitive and easy navigation API during many years. Every year we see new, better API: Native Navigator, ex-Navigator, NavigationExperimental, ex-Navigation, wix native navigation, airbnb native navigation, ReactNavigation...
Once I've started React Native development, in 2015, I created RNRF - simple API for easy navigation. It was clear that better navigation instruments will come later but I didn't want to change my code again and again to switch for better API. Every new major version of RNRF is based on different navigation framework and mostly preserves own API.
Another goal was to represent all navigation flow within one place in clear, human-readable way - similar to iOS Storyboards concept. This way other engineers could understand your app flow faster.
# this original one uses values returned from 'brew info' | |
brew list --formula | xargs -n1 -P8 -I {} \ | |
sh -c "brew info {} | egrep '[0-9]* files, ' | sed 's/^.*[0-9]* files, \(.*\)).*$/{} \1/'" | \ | |
sort -h -r -k2 - | column -t | |
# faster alternative using 'du' | |
du -sch $(brew --cellar)/*/* | sed "s|$(brew --cellar)/\([^/]*\)/.*|\1|" | sort -k1h |