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
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 |
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
### Keybase proof | |
I hereby claim: | |
* I am hqarroum on github. | |
* I am hqarroum (https://keybase.io/hqarroum) on keybase. | |
* I have a public key ASCwXPbkmeGc2VoIthKiwfRK_yciOT_dCayM_q2iBXv_Pwo | |
To claim this, I am signing this 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 <iostream> | |
#include <string> | |
#include <fstream> | |
#include <streambuf> | |
#include <chrono> | |
#include <thread> | |
#include <condition_variable> | |
#include <aws/core/Aws.h> | |
#include <aws/core/utils/Outcome.h> |
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
#!/bin/bash | |
# Stopping the script when a command's exit code signals a failure. \ | |
set -e | |
set -o pipefail | |
# Variables. \ | |
WLAN_INTERFACE='en0' |
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 <unistd.h> | |
int main(void) { | |
const char array[] = "Hello world !"; | |
const char* ptr = array; | |
while (*ptr) { | |
write(1, ptr++, 1); | |
} | |
return (0); |
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
typedef struct { | |
float f; | |
int member; | |
char c; | |
} t_struct; |
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
t_struct* get_struct_ptr(void* member); |
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
#define offsetof(st, m) ((size_t)(&((st*)0)->m)) |
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
size_t offset = offsetof(t_struct, member); |
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 <stdio.h> | |
#include <stddef.h> | |
/** | |
* An example structure that holds members of different | |
* types and sizes that we will be using in our example. | |
*/ | |
typedef struct { | |
float f; | |
int member; |
OlderNewer