This file contains 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 Service, Characteristic; | |
module.exports = function (homebridge) { | |
Service = homebridge.hap.Service; | |
Characteristic = homebridge.hap.Characteristic; | |
homebridge.registerAccessory(“switch-plugin”, “MyAwesomeSwitch”, mySwitch); | |
}; |
This file contains 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
mySwitch.prototype = { | |
getServices: function () { | |
let informationService = new Service.AccessoryInformation(); | |
informationService | |
.setCharacteristic(Characteristic.Manufacturer, “My switch manufacturer”) | |
.setCharacteristic(Characteristic.Model, “My switch model”) | |
.setCharacteristic(Characteristic.SerialNumber, “123–456–789”); | |
let switchService = new Service.Switch(“My switch”); | |
switchService | |
.getCharacteristic(Characteristic.On) |
This file contains 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 request = require(‘request’); | |
const url = require(‘url’); | |
function mySwitch(log, config) { | |
this.log = log; | |
this.getUrl = url.parse(config[‘getUrl’]); | |
this.postUrl = url.parse(config[‘postUrl’]); | |
} | |
mySwitch.prototype = { | |
getSwitchOnCharacteristic: function (next) { | |
const me = this; |
This file contains 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
namespace App\EventListener; | |
use App\Entity\Counting; | |
use App\Entity\User; | |
use Doctrine\ORM\Event\PrePersistEventArgs; | |
use Symfony\Component\Security\Core\Security; | |
class CountingEventListener | |
{ | |
/** |
This file contains 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
AWSTemplateFormatVersion: 2010-09-09 | |
Resources: | |
S3Bucket: | |
Type: AWS::S3::Bucket | |
Properties: | |
AccessControl: PublicRead | |
WebsiteConfiguration: | |
IndexDocument: index.html | |
ErrorDocument: error.html | |
DeletionPolicy: Retain |
This file contains 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
service: myServerlessService | |
provider: | |
name: aws | |
runtime: nodejs12.x | |
functions: | |
hello: | |
handler: index.hello | |
goodbye: |
This file contains 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
hello: | |
handler: index.hello | |
goodbye: | |
handler: index.goodbye |
This file contains 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
export default { | |
hello: { | |
handler: 'index.hello' | |
}, | |
goodbye: { | |
handler: 'index.goodbye' | |
} | |
}; |
This file contains 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
export { default as hello } from './hello'; | |
export { default as goodbye } from './goodbye'; |
This file contains 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 { DynamoDB } from 'aws-sdk'; | |
export default { | |
handler:'create.main', | |
environment: { | |
TABLE_NAME: { | |
Ref: 'MyTable' | |
} | |
}, | |
events: [ |
OlderNewer