Skip to content

Instantly share code, notes, and snippets.

View lusentis's full-sized avatar

Simone Lusenti lusentis

View GitHub Profile
@HQarroum
HQarroum / aws-iot-with-alpn.js
Last active May 4, 2020 15:05
Using the AWS IoT SDK with ALPN extensions to connect over MQTTS on port 443
const client = require('aws-iot-device-sdk');
// The options object to provision the MQTT client with.
// Update values between chevrons with the appropriate values.
const opts = {
host: "<aws-iot-endpoint>",
keyPath: "<path-to-private-key>",
certPath: "<path-to-device-certificate>",
caPath: "<path-to-root-ca>",
// We are specifying that we want to connect on the
@singledigit
singledigit / cognito.yaml
Last active April 28, 2024 15:12
Create a Cognito Authentication Backend via CloudFormation
AWSTemplateFormatVersion: '2010-09-09'
Description: Cognito Stack
Parameters:
AuthName:
Type: String
Description: Unique Auth Name for Cognito Resources
Resources:
# Creates a role that allows Cognito to send SNS messages
SNSRole:
@mxstbr
mxstbr / Readme.md
Last active December 20, 2023 12:01
Enable tab completion for JSX with Emmet in Atom

Enable tab completion for JSX with Emmet in Atom

This guide assumes you have the emmet and language-babel packages already installed in Atom

Gif of the tab completion working

  1. Open the keymap.cson file by clicking on Atom -> Keymap… in the menu bar
  2. Add these lines of code to your keymap:
'atom-text-editor[data-grammar~="jsx"]:not([mini])':
@lusentis
lusentis / objectstorage.js
Last active October 12, 2015 04:08
Object storage support for HTML5 Storage
/*global Storage:false */
/*jshint eqnull:true */
/*
* Extends Storage object to support storing JSON-encoded objects.
* (c) 2012 PlasticPanda.com
* License: MIT
*/
(function (Storage) {