Skip to content

Instantly share code, notes, and snippets.

View nkabrown's full-sized avatar

Nathan Brown nkabrown

View GitHub Profile
@nkabrown
nkabrown / react-native-port8081-workaround.md
Last active September 18, 2017 14:02
McAfee port 8081 workaround for react-native ios simulator

In <Project>/node_modules/react-native/React/React.xcodeproj/project.pbxproj replace all occurances of 'port 8081' with '8088'. Redone every time you npm install or yarn add a dependency

Open project in xcode by File -> Open -> <Project>.xcodeproj. Then go to <Project>/AppDelegate.m and change jsCodeLocation to jsCodeLocation = [NSURL URLWithString:@"http://127.0.0.1:8088/index.ios.bundle?platform=ios&dev=true"];

Run packager on port 8088 react-native start --port 8088.

Then run react-native run-ios.

Remove annoying Connection has no connected handler warning. react-native log-ios | grep -v nw_connection_get_connected

@nkabrown
nkabrown / frequencyTable.html
Last active October 6, 2017 18:36
frequency distribution table
<figure>
<figcaption>
</figcaption>
<table>
<thead>
</thead>
<tbody>
</tbody>
</table>
<small></small>
@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
@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

#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 / 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);
@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 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
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 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;