NX-SM400
This is the english version
Para a versão em português (pr-BR) use ESSE LINK
Recently, some smart plugs with the BR plug type started appearing on AliExpress
repeat | |
tell application "System Events" to delay 3.0 | |
-- tell application "System Events" to set currentApp to name of first process where frontmost is true | |
if application "Spotify" is running then | |
try | |
-- Create a random number to do one of three things | |
set randomNum to random number from 1 to 3 | |
if randomNum is 1 then | |
tell application "Spotify" to pause |
// From http://stackoverflow.com/a/39344394/3984316 | |
import UIKit | |
extension String { | |
init(htmlEncodedString: String) { | |
self.init() | |
guard let encodedData = htmlEncodedString.data(using: .utf8) else { |
#!/usr/bin/env python | |
""" Example of announcing a service (in this case, a fake HTTP server) """ | |
import logging | |
import socket | |
import sys | |
from time import sleep | |
from zeroconf import ServiceInfo, Zeroconf |
set voiceList to {"Agnes", "Kathy", "Princess", "Vicki", "Victoria", "Bruce", "Fred", "Junior", "Ralph", "Albert", "Bad News", "Bahh", "Bells", "Boing", "Bubbles", "Cellos", "Deranged", "Good News", "Hysterical", "Pipe Organ", "Trinoids", "Whisper", "Zarvox"} | |
repeat | |
repeat with voice in voiceList | |
tell application "System Events" to delay 3.0 | |
tell application "Finder" to say "Clarice!" using voice | |
end repeat | |
end repeat |
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME} | |
#end | |
#parse("File Header.java") | |
object ${NAME} { | |
interface View: BaseContracts.View { | |
//TODO | |
} | |
class LoginContracts { | |
interface View { | |
fun showError(message: String) | |
//fun presentHomeScreen(user: User) <- This is no longer a part of the View's responsibilities | |
} | |
interface Router { | |
fun presentHomeScreen(user: User) // Now the router handles it | |
} | |
} |
#!/bin/bash | |
cd | |
# useful vars | |
DATE=$(date +"%Y%m%d%H%M") | |
WHERE=~/backup/$DATE | |
# create dated backup folders | |
mkdir -p $WHERE/{sqlite,nodered,etc} | |
# safely backup sqlite db | |
# sqlite3 ~/dbs/iot.db ".backup $WHERE/sqlite/iot.db" | |
# backup json and js files |
This is the english version
Para a versão em português (pr-BR) use ESSE LINK
Recently, some smart plugs with the BR plug type started appearing on AliExpress
substitutions: | |
devicename: nome_do_nodo | |
ss_id: "Nome da Wifi" | |
pass: "Senha da Wifi" | |
switch4: "Nome switch4" | |
light_1: "Nome Luz1" | |
light_2: "Nome Luz2" | |
light_3: "Nome Luz3" | |
esphome: | |
name: ${devicename} |
interface LoginContracts { | |
interface View { | |
fun presentHomeScreen(user: User) | |
fun showError(message: String) | |
} | |
interface Presenter { | |
fun onDestroy() | |
fun onLoginButtonPressed(username: String, password: String) | |
} |