Skip to content

Instantly share code, notes, and snippets.

View nkabrown's full-sized avatar

Nathan Brown nkabrown

View GitHub Profile
@nkabrown
nkabrown / fibonacci.md
Last active July 29, 2016 18:08
C4Q Access Code — Application Workshop

Write a function that takes in an integer and returns an array of that size filled with the Fibonacci sequence.

function fibonacci(size) {
  // create an empty array to store our fibonacci sequence values
  var fibArray = [];
  
  // iterate the value of the size argument
  for (var i = 0; i < size; i++) {
 // if the array contains less than two elements push the value 1 into the array
@nkabrown
nkabrown / index.js
Last active July 25, 2016 21:22
requirebin sketch
const choo = require('choo');
const html = require('choo/html');
const app = choo();
// formula: tip total = (tip amount / 100) * bill amount
app.model({
state: { percent: ' ', amount: ' ', tip: ' ', total: ' ' },
reducers: {
calculateTip: (data, state) => {
@nkabrown
nkabrown / index.js
Created July 25, 2016 04:25
requirebin sketch
const choo = require('choo');
const html = require('choo/html');
const scale = require('d3-scale');
const request = require('d3-request');
const app = choo();
const width = 580;
const height = 500;
@nkabrown
nkabrown / index.js
Last active July 26, 2016 04:54
requirebin sketch
const choo = require('choo');
const html = require('choo/html');
const app = choo();
app.model({
state: { name: '' },
reducers: {
hello: (data, state) => ({ name: data })
}
@nkabrown
nkabrown / index.js
Created August 23, 2016 02:10
requirebin sketch
const choo = require('choo');
const html = require('choo/html');
const app = choo();
app.model({
state: { num1: '', num2: '' },
reducers: {
calculate: (data, state) => {
return { num1: +data.right, num2: +data.left }
}
@nkabrown
nkabrown / index.js
Created August 31, 2016 19:19
requirebin sketch
const choo = require('choo');
const html = require('choo/html');
const app = choo();
app.model({
state: { word: '', count: 0, answers: [] },
reducers: {
add: (data, state) => ({ word: data, count: data.length }),
save: (data, state) => {
@nkabrown
nkabrown / index.js
Created September 20, 2016 03:13
requirebin sketch
const choo = require('choo');
const html = require('choo/html');
const app = choo();
app.model({
state: { list: [] },
reducers: {
add: (data, state) => {
const newList = state.list.slice();
newList.push(data);

#Presentations

make sure that key repeat is low

test before hand on Windows and Mac

know what size magnification your screen needs to be for presentations

always make two demo videos — fast and slow

@nkabrown
nkabrown / mentorship.md
Last active May 23, 2017 17:35
Mentorship ideas

Git lesson

Explain the difference between a tree and graph data structure

Explain what a directed acyclic graph is

Talk about .git directory and sub-directories

Show the github api and demonstrate it by creating issues from the command line

@nkabrown
nkabrown / date-exercise.js
Created March 30, 2017 02:01
exercises with javascript date objects
// create a date object with today's date
// create a date object with the date of 1 January 2017
// find the number of days between today and 1 Jan 2017
// create an array of date objects from our start date to our end date
// randomly set a boolean workout property on each date object in our array