This file contains hidden or 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 is an example for our Monochrome OLEDs based on SH1107 drivers | |
| This example is for a 128x128 size display using I2C to communicate | |
| Adafruit invests time and resources providing this open source code, | |
| please support Adafruit and open-source hardware by purchasing | |
| products from Adafruit! | |
| Written by Limor Fried/Ladyada for Adafruit Industries. |
This file contains hidden or 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
| # SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries | |
| # | |
| # SPDX-License-Identifier: MIT | |
| """ | |
| Blink example for boards with ONLY a NeoPixel LED (e.g. without a built-in red LED). | |
| Includes QT Py and various Trinkeys. | |
| Requires two libraries from the Adafruit CircuitPython Library Bundle. | |
| Download the bundle from circuitpython.org/libraries and copy the |
This file contains hidden or 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
| """CircuitPython Essentials Digital In Out example""" | |
| import time | |
| import board | |
| from digitalio import DigitalInOut, Direction | |
| # LED setup. | |
| # For QT Py M0. QT Py M0 does not have a D13 LED, so you can connect an external LED instead. | |
| led = DigitalInOut(board.SCK) | |
| led.direction = Direction.OUTPUT |
This file contains hidden or 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 time | |
| import random | |
| import board | |
| import neopixel | |
| pixels = neopixel.NeoPixel(board.NEOPIXEL, 1, brightness=0.3) | |
| while True: | |
| rgbVar = (random.randint(0, 255), random.randint(0, 255), random.randint(0, 255)) | |
| pixels.fill(rgbVar) |
This file contains hidden or 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
| # -------------------------------------------------------------------- # | |
| # CircuitPython Analog In detection set RGB to random color example | |
| # -------------------------------------------------------------------- # | |
| import time, board, neopixel, random | |
| from analogio import AnalogIn | |
| analog_in = AnalogIn(board.A1) | |
| led = neopixel.NeoPixel(board.NEOPIXEL, 1, brightness=1) |
This file contains hidden or 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 rootSchema = { | |
| $schema: "http://json-schema.org/draft-04/schema#", | |
| title: "Person", | |
| description: "A person", | |
| type: "object", | |
| properties: { | |
| name: { | |
| description: "A person's name", | |
| type: "string", | |
| }, |
This file contains hidden or 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
| function arrayDiffSym(arr1, arr2) { | |
| return [ | |
| ...arr1.filter(item => !arr2.includes(item)), | |
| ...arr2.filter(item => !arr1.includes(item)), | |
| ]; | |
| } |
This file contains hidden or 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
| window.subscribers = []; | |
| const defaultState = { | |
| todos: [] | |
| }; | |
| const state = new Proxy(defaultState, { | |
| set(state, key, value) { | |
| const oldState = { ...state }; | |
This file contains hidden or 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
| function sum(arr) { | |
| return arr.reduce((a,b) => a + b); | |
| } | |
| function throttle(fn, ms) { | |
| let pending = false; | |
| return () => { | |
| if (!pending) { | |
| fn(); |
This file contains hidden or 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
| curl ifconfig.co/json | jq | |
| curl ifconfig.co/json | json_pp |