var greeting = 'Hello';
console.log(greeting); //=> Hello
if (true) {
var greeting = 'Hi';
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 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 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 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 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 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 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 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 |
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
const markdownEngine = markdownIt({ | |
html: true, | |
linkify: true | |
}); | |
const defaultRender = markdownEngine.renderer.rules.link_open || function(tokens, idx, options, env, self) { | |
return self.renderToken(tokens, idx, options); | |
}; | |
markdownEngine.renderer.rules.link_open = function (tokens, idx, options, env, self) { |