Skip to content

Instantly share code, notes, and snippets.

@nbogie
nbogie / recipe.json
Last active November 3, 2020 17:15
cyf - example recipe for recipe API
{
"title": "Adana",
"ingredients": [
"1 kg ground lamb",
"Kosher salt",
"4 teaspoons ground cumin, divided",
"4 tablespoons ground sumac, divided",
"4 tablespoon ground Urfa pepper flakes, divided",
"4 tablespoons ice-cold water"
],
@nbogie
nbogie / glitch-to-git.md
Last active May 16, 2019 02:15
CYF: Back up a glitch project to git (and then GitHub)

CYF: Back up a glitch project to git (and then GitHub)

These instructions are only needed if, like me, you don't want to have to trust glitch completely with permissions to read AND write your data on github directly.

Step: From your glitch project, click on "tools":

tools

@nbogie
nbogie / quotes.json
Last active May 13, 2019 13:46 — forked from nasrulhazim/quotes.json
Misc quotes list in JSON Format for CYF exercises
[
{
"quote": "Life isn’t about getting and having, it’s about giving and being.",
"author": "Kevin Kruse"
},
{
"quote": "Whatever the mind of man can conceive and believe, it can achieve.",
"author": "Napoleon Hill"
},
{
@nbogie
nbogie / pickRandomFromArray.js
Created May 4, 2019 23:32
a function which, when given an array of elements, will return one element picked at random from that array.
function pickRandom(arr) {
let ix = Math.floor(Math.random() * arr.length);
return arr[ix];
}
@nbogie
nbogie / NetlifyHosting.md
Last active June 19, 2019 16:56
CYF: Instructions for hosting with Netlify
/* Welcome to the JS quiz!
*
* This is to help mentors know what we need to do better.
*
* You are welcome to use MDN to check syntax: https://developer.mozilla.org
*/
/* Question 1
*
* Write a function that takes two numbers and returns the the largest number of the two.
@nbogie
nbogie / microbit-console-two_values_but_5_charts.txt
Last active February 16, 2019 14:48
two values but 5 charts! Capture of the microbit using serial write numbers to write a 2-element array - code here: https://makecode.microbit.org/_7PtcruikCbPA Makecode generates multiple charts from the data stream received from the microbit, though in the simulator the chart is reliably rendered as two lines on one chart.
0,255
0,255
0,255
0,255
0,255
6,249
7,248
7,248
7,248
6,249
@nbogie
nbogie / microbit-console-16-2019-14.txt
Last active February 16, 2019 14:08
exported csv and txt from makecode microbit serial recording. See screenshot in the comments.
0,255
0,255
0,255
0,255
0,255
13,242
18,237
24,231
27,228
@nbogie
nbogie / zipHaloShakeToSpin.ts
Created January 22, 2019 01:29
simple microbit zip halo / neopixel program to spin a light around when the device is shaken
let factor2 = 0
let strip: neopixel.Strip = null
let maxNeighbourBrightness = 0
let pxPos = 0
let maxBrightness = 0
let factor = 0
let fPos = 0
let braking = 0
let accel = 0
let speed = 0