Skip to content

Instantly share code, notes, and snippets.

View AlexLakatos's full-sized avatar
🥑
Developer Avocado

Alex Lakatos AlexLakatos

🥑
Developer Avocado
View GitHub Profile
@AlexLakatos
AlexLakatos / router.spec.ts
Created July 21, 2017 11:14 — forked from gsans/router.spec.ts
router.spec.ts
describe('Router tests', () => {
//setup
beforeEach(() => {
TestBed.configureTestingModule({
imports: [
RouterTestingModule.withRoutes(routes),
AppModule
]
});
});
var kb = require("ble_hid_keyboard");
NRF.setServices(undefined, { hid : kb.report });
var reset_timer;
var next = "n";
var prev = "p";
function sendCharNext(){
if (next == next.toLowerCase()){
sk = 0;
} else {
[
{
"action":"connect",
"from":"442038973497",
"endpoint":[{
"type":"phone",
"number":"447481738558"
}]
}
]
[
{
"action": "stream",
"streamUrl": [
"https://cdn.glitch.com/079cc071-4677-4893-bdb7-7b3f525ed26e%2Fcall-me-maybe-short.mp3?1550887955998"
]
},
{
"action": "conversation",
"name": "sbh"
$ npm init
$ npm install nexmo
@AlexLakatos
AlexLakatos / basic-express.js
Created September 16, 2019 08:56
How to Send and Receive SMS Messages With Node.js and Express
const app = require('express')()
const bodyParser = require('body-parser')
app.use(bodyParser.json())
app.use(bodyParser.urlencoded({ extended: true }))
app.listen(3000)
$ touch index.js
const Nexmo = require('nexmo')
const nexmo = new Nexmo({
apiKey: NEXMO_API_KEY,
apiSecret: NEXMO_API_SECRET
})
let text = "👋Hello from Nexmo";
nexmo.message.sendSms("Nexmo", "TO_NUMBER", text, {
type: "unicode"
}, (err, responseData) => {
if (err) {
console.log(err);
} else {
if (responseData.messages[0]['status'] === "0") {
console.log("Message sent successfully.");
const Nexmo = require('nexmo')
const nexmo = new Nexmo({
apiKey: NEXMO_API_KEY,
apiSecret: NEXMO_API_SECRET,
applicationId: NEXMO_APPLICATION_ID,
privateKey: NEXMO_APPLICATION_PRIVATE_KEY_PATH
})