Instantly share code, notes, and snippets.

View start-pi-camera-secure.sh
#!/bin/bash
# Make sure the NODE_MEDIA_PRIVATE_KEY environment variable is set
if [ -z ${NODE_MEDIA_PRIVATE_KEY+x} ]; then
echo "Make sure you set the NODE_MEDIA_PRIVATE_KEY is set";
exit -1;
fi
PI_IP_ADDRESS="192.168.1.71"
SERVER_IP_ADDRESS="192.168.1.71"
View app.js
const sensor = require('node-dht-sensor');
sensor.read(22, 4, function(err, temperature, humidity) {
if (err) {
console.log("AHHHHHHHH error", err);
return;
}
console.log('temp: ' + temperature.toFixed(1) + '°C, ' + 'humidity: ' + humidity.toFixed(1) + '%');
});
View banana.js
class Banana {
constructor () {
this.ripeness = 0;
}
age() {
this.ripeness++;
}
report() {
View raspi-access-point.sh
#!/bin/bash
# Based on https://somesquares.org/blog/2017/10/Raspberry-Pi-router/
SSID="MY-NETWORK"
WPA_PASSPHRASE="MY-PASSPHRASE"
# Enable ssh
touch /ssh
View RPS.md

👊 ✌️

You are going to create a very simple rock paper scissors game. It will consist of three buttons, one for each of the moves you can play. Tap on one of these buttons to chose your move, then the iPhone will randomly choose a move and a you either win, lose, or 👔.

Screenshot of app

Rules of Rock Paper Scissors:

  • Each sign can beat one (and only one) other:
  • Rock smashes scissors.
View pointers-and-functions.c
#include <stdio.h>
int squaringNumber(int num) {
int square = num * num;
return square;
}
void squareNumber(int *numberReference) {
int num = *numberReference;
int square = num * num;
View apple-developer-enrollment.md

Apple Developer Program

Sometime in week 8 you will be uploading your final project to TestFlight so you can share it with other people.

During development of you iOS app, you want to try and get feedback from users as early and frequently as possible. To test your app on your iPhone, you just plug your phone into your Mac and run the Xcode project. But how can you run your app on other people's devices for testing? What if you're testers are spread out across the world?

TestFlight Beta Testing is an Apple product that makes it easy to invite users to test your iOS apps so you can get feedback and make changes before you release it to the App Store.

TestFlight Beta Testing makes it easy to invite users to test your iOS, watchOS, and tvOS apps before you release them on the App Store. You can invite up to 2,000 testers using just their email address. -- https://developer.apple.com/testflight/

View NSAllowsArbitraryLoadsInMedia.xml
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoadsInMedia</key><true/>
</dict>