Skip to content

Instantly share code, notes, and snippets.

View ryan-hamblin's full-sized avatar
🏳️‍🌈
Working from home

Ryan Hamblin ryan-hamblin

🏳️‍🌈
Working from home
  • ExtraSpace Storage
  • United States
View GitHub Profile
// This is my child Pie Chart Component.
import React, {Component} from 'react';
import ReactD3 from 'react-d3-components';
const PieChart = ReactD3.PieChart;
class GroupsPieChart extends Component {
constructor(props){
super(props);
this.state = {
let tooltipLine = function(label, data) {
return data.y;
}
I'm loading the data in via componentDidMount and pushing the array to state. The data is loading fine. I just get
errors when trying to use the toolTip functionality. Do I need to define "Xscale on my own?".
return (
<LineChart
data={this.state.data}
width={825}
height={250}
import React, { Component, PropTypes } from 'react';
import { StyleSheet, css } from 'aphrodite';
class Pagination extends Component {
constructor(props){
super(props);
this.state = {
pageNodes: [],
}
this._paginationBuilder = this._paginationBuilder.bind(this);
import React,{PropTypes, Component } from 'react'
import {StyleSheet,css} from 'aphrodite';
class Pretty extends Component {
constructor(props){
super(props);
this.state= {
show: false,
flag: false,
};
// var name = 'Ryan';
// name = 'Ben';
// var name = 'Austen';
// console.log(name);
function logName() {
function foo() {
console.log(name);
}
return foo();
@ryan-hamblin
ryan-hamblin / Reduce-Flatten.js
Created September 9, 2017 01:20
reduce and flatten methods from ground up
const nums = ['1', '2', '3', '4', '5'];
const listOfPeeps = [
{
_id: '123512',
name: 'Ryan',
friends: ['Hermione', 'Ron', 'Harry', 'Draco'],
},
{
name: 'Donnie', _id: '32434',
// Mini-Bootcamp: Lesson 1 - Intro To ES6 and BEYOND!
// let, const are new to JavaScript as of 2015.
// ES6 - ES2015;
// math --> + - * / %
const name = 'Ryan'; // --> String
let age = 12; // --> Number
let isEven = false; // --> Boolean
let checkedIfEven = age % 2;
console.log(checkedIfEven);
@ryan-hamblin
ryan-hamblin / arrays.js
Created October 2, 2017 23:58
for loops with ryan
const arrayOfStrings = ['Hello', 'Hola', 'Oi', 'Neehow', 'Guten Tag'];
const arrayOfInts = [1, 2, 3, 4, 5];
const ln = arrayOfStrings.length;
console.log(ln);
console.log(arrayOfStrings[1]);
for (let i = 0; i < ln; i++) {
console.log(arrayOfStrings[i], i);
}
@ryan-hamblin
ryan-hamblin / server.js
Created October 3, 2017 00:34
Solution File for your Auth Sprint
const bcrypt = require('bcrypt');
const bodyParser = require('body-parser');
const express = require('express');
const session = require('express-session');
const cors = require('cors');
const User = require('./user.js');
const STATUS_USER_ERROR = 422;
const BCRYPT_COST = 11;
@ryan-hamblin
ryan-hamblin / testing.js
Created October 10, 2017 00:57
testing schtuff
const chai = require('chai');
const sinon = require('sinon');
const sinonChai = require('sinon-chai');
const cases = require('../src/app.js');
const expect = chai.expect;
const assert = chai.assert;
chai.use(sinonChai);
describe('Cases from app.js', () => {
describe('apples', () => {