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
<?php | |
namespace Tests\Unit; | |
use Faker\Factory; | |
use PHPUnit\Framework\TestCase; | |
class PropertyBasedTest extends TestCase | |
{ | |
public function propertyBaseData() |
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
var awsIot = require('aws-iot-device-sdk'); | |
// Replace this with the DEVICE ID | |
let thingName = 'DEVICE_ID'; | |
var thingShadow = awsIot.thingShadow({ | |
keyPath: __dirname + '/custom-certs/aws_rsa_private.pem', | |
certPath: __dirname + '/custom-certs/aws_rsa_cert.pem', | |
caPath: __dirname + '/AmazonRootCA1.pem', | |
clientId: 'myFakeClientId', |
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
<?php | |
class AwsIotProvider implements IotProvider | |
{ | |
public function createDevice(DeviceId $deviceId, Certificate $rootCertificate): void | |
{ | |
(new Pipeline(app())) | |
->send( | |
Aws\Tasks\CreateIotDeviceTask::forDeviceId($deviceId) | |
->withPolicyName(config('iot.providers.aws.devices.policy_name')) |
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
<?php | |
// 1. Register the routes | |
Route::get('test/{lorem}', function ($lorem) { | |
sleep(3); | |
return response()->json([ | |
'message' => $lorem, | |
'token' => Str::random(), | |
]); |
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
<?php | |
$graph = [ | |
"start" => [ | |
"a" => 6, | |
"b" => 2, | |
], | |
"a" => [ | |
"end" => 1 | |
], |
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
<template> | |
<a :href="`/services?serviceId=${service.id}`">Link</a> | |
</template> | |
<script> | |
export default { | |
data() { | |
return { | |
service: { | |
id: 123, |
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 TurbolinksAdapter from 'vue-turbolinks'; | |
document.addEventListener('turbolinks:load', () => { | |
var vueapp = new Vue({ | |
el: "#hello", | |
template: '<App/>', | |
mixins: [TurbolinksAdapter], | |
components: { App } | |
}); | |
}); |
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 React, { useEffect, useReducer } from 'react'; | |
import Layout from "@/Components/Layout"; | |
const CONNECTION_STATUSES = { | |
ONLINE: 'ONLINE', | |
OFFLINE: 'OFFLINE', | |
}; | |
const actions = { |
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
class Deployment | |
def mark_as_finished | |
# ... | |
end | |
def mark_as_timedout | |
# ... | |
end | |
def cancel |
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
<?php | |
class BuildingsController | |
{ | |
public function index( | |
ListBuildingsRequest $request, | |
BuildingsRepository $buildings | |
) { | |
// Not sure how to return data here. For instance, we can return 'users_count' | |
// of Buildings, but a Building has many Organisations which has many users |