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 { AirtopClient } from "@airtop/sdk"; | |
import puppeteer from "puppeteer-core"; | |
const apiKey = "YOUR_AIRTOP_API_KEY"; | |
const client = new AirtopClient({ apiKey }); | |
// Step 1: Create a session | |
const session = await client.sessions.create(); | |
// Step 2: Connect to the browser |
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
addEventListener('fetch', event => { | |
event.respondWith(handleRequest(event.request)) | |
}) | |
async function handleRequest(request) { | |
const url = new URL(request.url) | |
// Check if the path starts with /blog | |
if (url.pathname.startsWith('/blog')) { | |
const subPath = url.pathname.replace('/blog', '') | |
const githubUrl = new URL(`SOURCE_URL${subPath}`) |
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
#include <Bounce2.h> | |
#define BUTTON_PIN PB4 | |
#define led1Pin PB0 | |
#define led2Pin PB1 | |
#define led3Pin PB2 | |
#define led4Pin PB3 | |
#define switchPin PB4 | |
#define delayInterval 100 | |
Bounce debouncer = Bounce(); // Instantiate a Bounce object |
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
#include <avr/sleep.h> | |
#include <avr/interrupt.h> | |
#include <Heart.h> | |
/* | |
Android Beating Heart V2- Sketch | |
Marcos Placona 2019 | |
*/ | |
const int switchPin = 3; |
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
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) | |
- val myData = DataSource() | |
- tvMagicNumber.text = myData.getMagicNumber().toString() | |
+ val model = ViewModelProviders.of(this).get(DataSource::class.java) | |
+ tvMagicNumber.text = model.getMagicNumber().toString() | |
} |
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
package uk.co.placona.jetpackdemo1 | |
- class DataSource { | |
+ import android.arch.lifecycle.ViewModel | |
+ | |
+ class DataSource: ViewModel() { | |
private val tag = MainActivity::class.java.simpleName | |
private lateinit var myRandomNumber:Number |
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
implementation 'com.android.support:appcompat-v7:28.0.0' | |
implementation 'com.android.support.constraint:constraint-layout:1.1.3' | |
+ def lifecycle_version = "1.1.1" | |
+ implementation "android.arch.lifecycle:extensions:$lifecycle_version" | |
testImplementation 'junit:junit:4.12' | |
androidTestImplementation 'com.android.support.test:runner:1.0.2' | |
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' |
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
private fun createMagicNumber(){ | |
myRandomNumber = (1..42).shuffled().first() | |
} |
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
exports.handler = function (context, event, callback) { | |
/***** configuration *****/ | |
const phoneNumber = 'YOUR_PHONE_NUMBER'; | |
const timeout = event.Timeout || 12; | |
const secureRecordingLinks = false; | |
const voiceOpts = { |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<Response> | |
<Message to="YOUR_PHONE_NUMBER"> | |
{{From}}: {{Body}} | |
</Message> | |
</Response> |
NewerOlder