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
#standardSQL | |
SELECT | |
ST_GeogPoint(longitude, latitude) AS point, | |
name, | |
iso_time, | |
dist2land, | |
usa_wind, | |
usa_pressure, | |
usa_sshs, | |
(usa_r34_ne + usa_r34_nw + usa_r34_se + usa_r34_sw)/4 AS radius_34kt, |
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
apiVersion: batch/v1 | |
kind: Job | |
metadata: | |
name: demo-job | |
spec: | |
template: | |
metadata: | |
name: demo-job | |
spec: | |
containers: |
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
# Preview more ports on Cloud Shell | |
By default, GCP Cloud Shell allows us to preview local servers on ports 8080 through 8084. These are often the default ports used for previsualizing. | |
[Docs](https://cloud.google.com/shell/docs/features#web_preview) are clear about this, but sometimes we need or find more convenient to use ports in a different range. | |
## Exammple | |
By default, Google App Engine SDK (for standard environment's Python runtime at least) uses port 8000 for the admin local server dashboard, so it seems we can't access it without changing it to another port first. |
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 RPi.GPIO as GPIO | |
import time | |
GPIO.setmode(GPIO.BCM) | |
PIN_MOTOR1 = 2 | |
PIN_MOTOR2 = 3 | |
PIN_MOTOR3 = 4 | |
GPIO.setup(PIN_MOTOR1, GPIO.OUT) |
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 RPi.GPIO as GPIO | |
import time | |
GPIO.setmode(GPIO.BCM) | |
# Read SPI data from MCP3008 | |
def readadc(adcnum, clockpin, mosipin, misopin, cspin): | |
if ((adcnum > 7) or (adcnum < 0)): | |
raise ValueError('ADC num between 0 and 7') |
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 RPi.GPIO as GPIO | |
import time | |
GPIO.setmode(GPIO.BOARD) | |
PIN_LED = 12 | |
GPIO.setup(PIN_LED, GPIO.OUT) | |
p = GPIO.PWM(PIN_LED, 50) |
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 RPi.GPIO as GPIO | |
import time | |
GPIO.setmode(GPIO.BOARD) | |
GPIO.setup(12, GPIO.OUT) | |
try: | |
while True: | |
GPIO.output(12, True) | |
time.sleep(0.5) |
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
#!/usr/bin/env python | |
import time | |
import os | |
import RPi.GPIO as GPIO | |
GPIO.setmode(GPIO.BCM) | |
# Read SPI data from MCP3008 | |
def readadc(adcnum, clockpin, mosipin, misopin, cspin): |
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
#!/usr/bin/env python | |
import time | |
import os | |
import RPi.GPIO as GPIO | |
GPIO.setmode(GPIO.BCM) | |
# Read SPI data from MCP3008 | |
def readadc(adcnum, clockpin, mosipin, misopin, cspin): |
NewerOlder