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
    
  
  
    
  | # Export as Text Table | |
| aws --region XXXXXXXXX cognito-idp list-users --user-pool-id XXXXXXXXXXXXX --output table > ~/users.txt | |
| # Export as JSON | |
| aws --region XXXXXXXXX cognito-idp list-users --user-pool-id XXXXXXXXXXXXX --output json > ~/users.json | |
| # Export User Pool with more than 60 users (pagination) | |
| aws --region XXXXXXXXX cognito-idp list-users --user-pool-id XXXXXXXXXXXXX --pagination-token INCREDIBLYLONGSTRINGHERE --output json > ~/users-2.json | 
  
    
      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
    
  
  
    
  | "use strict"; | |
| // Websocket | |
| let webSocketsServerPort = 1341; | |
| let webSocketServer = require("websocket").server; | |
| let http = require("http"); | |
| let server = http.createServer(function (request, response) { | |
| // Not important for us. We're writing WebSocket server, not HTTP server | |
| }); | |
| let clients = []; | 
  
    
      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
    
  
  
    
  | <p>Try pressing the keyboard or scan</p> | |
| <p id="log"></p> | |
| <script> | |
| const log = document.getElementById('log'); | |
| var d = []; | |
| document.addEventListener('keypress', logKey); | 
  
    
      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
    
  
  
    
  | window.onkeydown = function (e) { | |
| let code = e.code; | |
| let key = e.key; | |
| if (key === "Shift") { | |
| } else { | |
| d.push(key); | |
| if (code === "ArrowDown") { | |
| console.log("data", d); | |
| delete d[(d.length - 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
    
  
  
    
  | http://apassant.net/2012/01/16/timeout-for-html5-localstorage/ | |
| var hours = 24; // Reset when storage is more than 24hours | |
| var now = new Date().getTime(); | |
| var setupTime = localStorage.getItem('setupTime'); | |
| if (setupTime == null) { | |
| localStorage.setItem('setupTime', now) | |
| } else { | |
| if(now-setupTime > hours*60*60*1000) { | |
| localStorage.clear() | 
  
    
      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
    
  
  
    
  | 'use strict'; | |
| ////////////////////////////////// | |
| // How to use? | |
| // 1. Create `sequelize-schema-file-generator.js` in your app root | |
| // 2. Make sure you've ran the `sequelize init` before (It should create `config`,`seeders`,`migrations` folders). | |
| // 3. Update `DATABASE_DSN` below to match your connection string (works with any database adapter that Sequelize supports) | |
| // 4. Run it with `node sequelize-schema-file-generator.js` | |
| // 5. Review the generated migrations inside of the `migrations` folder. | |
| ////////////////////////////////// |