Skip to content

Instantly share code, notes, and snippets.

View biglovisa's full-sized avatar
🌍
Patch is hiring!

Lovisa Svallingson biglovisa

🌍
Patch is hiring!
View GitHub Profile
@biglovisa
biglovisa / _dashboard.js
Last active November 9, 2015 18:12
React session
// Annotated Code -- CRUD with Rails-React
// Functions we get from the React framework will be marked with -> R!
// to get the full repo: `$ git clone git@github.com:applegrain/ideabox-react.git`
// https://facebook.github.io/react/docs/thinking-in-react.html
// Good read to get into the React state of mind
// Create a new dashboard component.
var Dashboard = React.createClass({
@biglovisa
biglovisa / intermission-recap.md
Last active November 30, 2015 18:53
Intermission week recap

November 30th 2015 1507

  • chaining APIs & LoDash
  • how/when to use jQuery
  • jQuery fundamentals was good to get the basics, but didn't cover when/where to use it
@biglovisa
biglovisa / 01-dec-2015.md
Last active December 1, 2015 19:00
December 1

Tuesday December 1 1507

IdeaBox PSA

  • http://jsbin.com/nuhuyurami/4/edit?js,output
  • underscore.js #template)[http://underscorejs.org/#template
  • in application.js, with the asset pipeline, it will first require jQuery and then tree .
    • This means that the Rails asset pipeline will take all your JavaScript and jam it all together into one massive file
    • The compiled file is required in app/views/layouts/application.html.erb and therefore available to you anywhere (whether you like it or not) in your application
@biglovisa
biglovisa / 07-dec-2015.md
Last active December 7, 2015 16:51
Mon December 7

Monday December 7, 2015

1507

Morning challenge

  • It starts out with five buttons.
  • When you click the first button, it alerts the us that "Button #1" has been clicked.
  • The equivalent works for the second, third, fourth, and fifth buttons.
  • There is an additional button for adding new buttons.
  • When added and subsequently clicked, the sixth button will log that "Button #6" was clicked.
@biglovisa
biglovisa / 09-dec-2015.md
Created December 9, 2015 15:24
Wed December 9
@biglovisa
biglovisa / state-vs-props.js
Last active December 15, 2015 04:54
react: state vs props
//-------------------------------Main (parent) component
var Main = React.createClass({
// props: name (data)
// state: counter (data)
getInitialState: function() {
return { counter: 0 };
},
handleClick: function() {
this.setState({ counter: ++this.state.counter });