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 'dart:convert'; | |
import 'package:intl/intl.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:fluids/plugins/weather/models/models.dart'; //custom data models | |
import 'package:fluids/utils/md_icons.dart'; //material design community icons | |
class CityForecast extends StatelessWidget { | |
final GlobalKey<AnimatedListState> _listKey = GlobalKey<AnimatedListState>(); | |
final String city; | |
final String state; |
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
#include <ESP8266WiFi.h> | |
#include <WiFiUdp.h> | |
void setup() { | |
int cnt = 0; | |
// set for STA mode | |
WiFi.mode(WIFI_STA); | |
// put your setup code here, to run once: |
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
//https://github.com/rcarmo/azure-iot-esp-01-minimal-cpp/blob/master/iothub.cpp | |
//http://bitoftech.net/2014/12/15/secure-asp-net-web-api-using-api-key-authentication-hmac-authentication/ | |
/* | |
var hmac = crypto.createHmac('sha256', secret_key); | |
hmac.update(request.body.message); | |
var signature = hmac.digest('hex')); | |
*/ | |
var str = payload_string; |
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
/* | |
Version 0.1 - Jan 05 2019 | |
*/ | |
#include <Arduino.h> | |
#include <ESP8266WiFi.h> | |
#include <ESP8266WiFiMulti.h> | |
#include <WebSocketsClient.h> // https://github.com/kakopappa/sinric/wiki/How-to-add-dependency-libraries | |
#include <ArduinoJson.h> // https://github.com/kakopappa/sinric/wiki/How-to-add-dependency-libraries | |
#include <StreamString.h> |
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
https://engineering.gosquared.com/optimising-nginx-node-js-and-networking-for-heavy-workloads | |
https://qunfei.wordpress.com/2016/09/20/from-c10k-to-c100k-problem-push-over-1000000-messages-to-web-clients-on-1-machine-simultaneously/ |
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
/** | |
* MongoDB NodeJS Driver Production Connection Example | |
* | |
* Copyright (c) 2015 ObjectLabs Corporation | |
* Distributed under the MIT license - http://opensource.org/licenses/MIT | |
*/ | |
var MongoClient = require('mongodb').MongoClient; | |
/** |
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
#!/bin/bash | |
MONGO_DATABASE="your_db_name" | |
APP_NAME="your_app_name" | |
MONGO_HOST="127.0.0.1" | |
MONGO_PORT="27017" | |
TIMESTAMP=`date +%F-%H%M` | |
MONGODUMP_PATH="/usr/bin/mongodump" | |
BACKUPS_DIR="/home/username/backups/$APP_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
import java.security.MessageDigest; | |
import javax.crypto.Cipher; | |
import javax.crypto.spec.SecretKeySpec; | |
import javax.xml.bind.DatatypeConverter; | |
public class AES { | |
private static byte[] iv = "0000000000000000".getBytes(); | |
private static String decrypt(String encrypted, String seed) |
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
// Dart | |
void _incrementCounter() { | |
String secret = "762c4144-1630-4fab-9161-0fef8b18d316"; | |
List<int> key = utf8.encode(secret); | |
String message = "clientId=android-app&type=action&ts=1550493108338&actions=%5B%7B%22name%22%3A%22setOn%22%2C%22parameters%22%3A%7B%7D%7D%5D"; | |
List<int> messageBytes = utf8.encode(message); | |
Hmac hmac = new Hmac(sha256, key); | |
Digest digest = hmac.convert(messageBytes); |
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
#include "FS.h" | |
#include "esp_system.h" | |
#include <esp_wifi.h> | |
#include <string.h> | |
#include <WiFi.h> | |
#include <Preferences.h> // WiFi storage | |
const char* rssiSSID; // NO MORE hard coded set AP, all SmartConfig | |
const char* password; | |
String PrefSSID, PrefPassword; // used by preferences storage |