View terraform_snippets.code-snippets
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
Show hidden characters
{ | |
// Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and | |
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope | |
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is | |
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are: | |
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. | |
// Placeholders with the same ids are connected. | |
// Example: | |
// "Print to console": { | |
// "scope": "javascript,typescript", |
View minecraft_parabolas.py
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
x, y, z = player.position | |
z += 10 | |
def f(a): | |
return -(a ** 2) // 2 + 25 | |
for i in range(-20,20): | |
pos1 = (x + i, y+ f(i), z) | |
pos2 = (x + i, y+ f(i+1), z) |
View agent_mineshaft.py
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
directions = ("left","right","up", "down") | |
ignore_bricks = ['dirt','stone', "gravel", "air"] | |
def dig_inspect(direction): | |
"""Inspects for uncommon brick types and then digs them anyway""" | |
block = agent.inspect(direction) | |
while block not in ("air", "torch"): | |
if block not in ignore_bricks: | |
say(f"Found {block} to the {direction}. Destroying anyway") |
View sierpinski.py
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
# Write your code here :-) | |
# idea from this YouTube video: https://www.youtube.com/watch?v=kbKtFN71Lfs | |
import random | |
import turtle as t | |
def midpoint(point1, point2): | |
# given two coordinates, find the point halfway between them | |
x1, y1 = point1 | |
x2, y2 = point2 |
View minecraft_aquarium.py
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
def item_interacted_trident(): | |
blocks.fill(SANDSTONE, | |
pos(5, -1, -10), | |
pos(12, -1, 10), | |
FillOperation.REPLACE) | |
blocks.fill(GLASS, | |
pos(5, 0, -10), | |
pos(12, 7, 10), | |
FillOperation.REPLACE) | |
blocks.fill(WATER, pos(6, 0, -9), pos(11, 7, 9), FillOperation.REPLACE) |
View flask_app.py
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
# A very simple Flask Hello World app for you to get started with... | |
from flask import Flask, render_template | |
import random | |
students = ['Alison','George', 'Jonah','Jake','Peter','Tyler','Savannah','Aviah','Taylor','Ellie','Shaun','Aiden'] | |
app = Flask(__name__) |
View gist:f6ca28987b419a701b6349055450939b
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
# this program detects a button press and lights up a new Led, 2nd button changes colors | |
from adafruit_circuitplayground.express import cpx, time | |
# pick how many colors to use | |
color_mode = 3 | |
RED = (255, 0, 0) | |
GREEN = (0, 255, 0) |
View gist:608186579b2683265d56aa457f7c4b91
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
# this program detects a button press and lights up a new Led, 2nd button changes colors | |
from adafruit_circuitplayground.express import cpx, time | |
cpx.pixels.brightness = 0.3 | |
cpx.pixels.fill((0, 0, 0)) | |
# pick how many colors to use | |
color_mode = 3 |
View tasks.json
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
{ | |
// See https://go.microsoft.com/fwlink/?LinkId=733558 | |
// for the documentation about the tasks.json format | |
"version": "2.0.0", | |
"tasks": [ | |
{ | |
"label": "Copy to CircuitPython Device", | |
"type": "shell", | |
"command": "cp -f ${file} /Volumes/*PY/code.py", | |
"presentation": { |
View cpx_traffic_light.py
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 neopixel | |
import time | |
import board | |
from adafruit_itertools.adafruit_itertools import cycle | |
pixels = neopixel.NeoPixel(board.NEOPIXEL, 10, brightness=0.1, auto_write=False) | |
RED = (255, 0, 0) | |
YELLOW = (255, 255, 0) | |
GREEN = (0, 255, 0) |
NewerOlder