- Learn how to start a new react native project
- Run it on ios simulator, on android emulator, on a real iPhone device and on a real Android device, with and without debugging enabled.
- Learn how to upgrade a react native project
- Learn how to add a package to the project
- Learn how to add a package that has a native dependency (https://github.com/airbnb/react-native-maps, https://github.com/evollu/react-native-fcm) - DO NOT USE COCOAPODS
- Learn how to use fetch to get data from your backend
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
var http = require('https'); | |
var querystring = require('querystring'); | |
// set the post request options | |
var reqOptions = { | |
hostname: 'hooks.slack.com', | |
port: 443, | |
path: '/services/YOUR/SLACK/HOOK_HERE', | |
method: 'POST' | |
}; |
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 | |
# v0.0.2 | |
# AWS Deploy Script for Travis | |
# Remember to add the env var in the travis configuration | |
# in order to work, this scripts needs: | |
# AWS_ACCESS_KEY_ID: user ID | |
# AWS_SECRET_ACCESS_KEY: user secret | |
# APP_NAME: EBS application name | |
# ENV_NAME: EBS application env | |
# S3_BUCKET: name of the S3 bucket to store deployment archive |
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
// based on: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-node-node-getstarted#create-a-device-identity | |
const iothub = require('azure-iothub'); | |
const connectionString = '{iothub connection string}'; | |
const registry = iothub.Registry.fromConnectionString(connectionString); | |
const device = { | |
deviceId: 'myFirstNodeDevice' | |
}; | |
registry.create(device, function(err, deviceInfo, res) { |
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
// based on: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-node-node-getstarted#receive-device-to-cloud-messages | |
const EventHubClient = require('azure-event-hubs').Client; | |
const connectionString = '{iothub connection string}'; | |
const printError = (err) => { | |
console.err(err.message); | |
} | |
const printMessage = (message) => { |
This provides a minimal setup for running grafana, graphite and statsd in docker containers for experimenting. Not suitable for production environment as additional security configuration is required.
Assuming you have docker installed and ready for use:
- Run official grafana image:
docker run -d -p 3000:3000 grafana/grafana
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
docker run -e KEYCLOAK_USER=<USERNAME> -e KEYCLOAK_PASSWORD=<PASSWORD> -e DB_VENDOR=H2 -p 8080:8080 jboss/keycloak | |
docker cp <CONTAINERID>:/opt/jboss/keycloak/themes ~/keycloak-themes |
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
import config from '../config'; | |
import winston from 'winston'; | |
const logger = new (winston.Logger)({ | |
level: config.log.level, | |
transports: [ | |
new winston.transports.Console({ | |
colorize: true, | |
timestamp: true, | |
}) |
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
Using sudo is a great way to make things happen, but most people neglect to understand everything that happens when sudo is used. Particularly with npm, and npm modules, using sudo can result in things being performed by root which the user doesn't want to have be performed by root, such as file creation or use of protected ports. Basically, the "use sudo" advice falls flat on its face (perhaps after stumbling and staring into the sun for a moment) where nvm/npm/node is concerned. – bschlueter Aug 1 '16 at 22:43 |
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
crontab -l | { cat; echo "0 11 * * * export DISPLAY=:0 && google-chrome https://google.com"; } | crontab - |
OlderNewer