Skip to content

Instantly share code, notes, and snippets.

nbogie

View GitHub Profile
@nbogie
nbogie / react-week-3-student-issues.md
Last active Jun 5, 2020
student issues: react week 3
View react-week-3-student-issues.md

React week 3 - student questions and issues for class

  • setFoo doesn't magically update foo (useState):
  • useState("someinitvalue") only initialises the variable the first time the component is ?rendered?. Subsequent calls to useState return the new current value of the variable.
  • passing props down and down. useContext? "
    • should I learn redux?
  • "should i learn class components?"
  • to investigate: synthetic events an issue?
@nbogie
nbogie / js-exercises-with-data.md
Last active Jun 5, 2020
JS exercises - working with data
View js-exercises-with-data.md

pure js exercises using data

home-made

  • tv maze - pure JS exercises (in repl)
  • jobs listing pure JS exercises (in mahmut's repl)
    • get all the company titles and positions of every job [{company: CYF, position: programmer}, ...], etc
  • stuff from my json-examples netlify
  • p5js (filter points by dist(), find points by same, find enemies with low hit-points, etc)
@nbogie
nbogie / live-coding-plan-random-polygons.md
Last active Jun 4, 2020
live coding plan - random polygons
View live-coding-plan-random-polygons.md
@nbogie
nbogie / rough-notation-bookmarklet.js
Last active May 28, 2020
bookmarklet demoing "hand-drawn" annotations with rough-notation library. Will highlight p and a tags.
View rough-notation-bookmarklet.js
javascript: (async () => { const RoughNotation = await import('https://unpkg.com/rough-notation?module'); const pick = (arr) => arr[Math.floor(Math.random() * arr.length)]; const colorNames = "#66FF66 #FD5B78 #FF9966 #FFFF66 #50BFE6 #FF00CC".split(" "); document.querySelectorAll('p').forEach(elem => { RoughNotation.annotate(elem, { type: 'box', color: 'black', strokeWidth: pick([1, 2, 5]) }).show(); }); document.querySelectorAll('a').forEach(elem => { RoughNotation.annotate(elem, { type: 'highlight', color: pick(colorNames) }).show(); elem.style.color = 'black'; }); })()
@nbogie
nbogie / rough-notation-devtools-oneliner.js
Last active May 29, 2020
An example one-liner to annotate all 'p' and 'a' tags in the current page. Paste it into the devtools. (if you trust the 'rough-notation' module)
View rough-notation-devtools-oneliner.js
(async () => {
const RoughNotation = await import('https://unpkg.com/rough-notation?module');
const pick = (arr) => arr[Math.floor(Math.random() * arr.length)];
const colorNames = "#66FF66 #FD5B78 #FF9966 #FFFF66 #50BFE6 #FF00CC".split(" ");
document.querySelectorAll('p').forEach(elem => {
RoughNotation.annotate(elem, { type: 'box', color: 'black', strokeWidth: pick([1, 2, 10]) }).show();
});
document.querySelectorAll('a').forEach(elem => {
@nbogie
nbogie / high-scores.js
Created May 20, 2020
data for high score table react quick exercise
View high-scores.js
let allCountryScores = [
{
name: "Ethiopia",
scores: [ {n: "Hanif", s: 999999999}, {n: "neill", s: 999999}, {n: "bob", s: "4134234"}, {n: "Hanif", s: "700"}]
},
{
name: "Scotland",
scores: [ {n: "lucy", s: 9999}, {n: "groundkeeper willie", s: 4000}, {n: "braveheart", s: 200}]
},
{
View ubuntu-create-react-app-and-london-class-6.md

Getting create-react-app working on Ubuntu (19.04)

problems and solutions

Main success conditions to be met:

We will be done if...

  • npx create-react-app is runs and completes successfully
  • student can run the react app created by the above
View tree_technique_blender.md

1. make the tree structure shape

  • make single vertex

  • extrude it

2. skin it

  • add skin modifier

adjust thicknesses:

  • in edit mode
You can’t perform that action at this time.