Skip to content

Instantly share code, notes, and snippets.

View theonlyrao's full-sized avatar

Ashwin Rao theonlyrao

View GitHub Profile
@theonlyrao
theonlyrao / working_spec.rb
Created August 8, 2016 17:07
Adding `it` block fixes the error
RSpec.feature "AnonymousUserDoesNotSeeLinks", type: :feature do
describe "anonymous user" do
it "does not see links" do
visit root_path
within(".header") do
expect(page).not_to have_content("Links")
end
end
end
end
@theonlyrao
theonlyrao / method_missing_spec.rb
Last active August 8, 2016 17:08
Test that produces `method_missing` error from RSpec::Core
RSpec.feature "AnonymousUserDoesNotSeeLinks", type: :feature do
describe "anonymous user" do
visit root_path
within(".header") do
expect(page).not_to have_content("Links")
end
end
end
@theonlyrao
theonlyrao / ashwin-plan-goals.md
Last active August 1, 2016 21:02
"Goals" from The Plan

#Goals

##learn Clojure

current status: have Horace's curriculum and have done a little work

success in 1 year: have a deployed web app written clojure that does something like ideabox with users

resources for learning: clojure for the brave and true, Horace, meetups

@theonlyrao
theonlyrao / second.js
Created July 29, 2016 04:23
Using 'componentDidUpdate` to render component in separate div
import React from 'react';
import ReactDOM from 'react-dom';
const Letter = React.createClass({
render() {
return (
// same html stuff ...
)
}
});
@theonlyrao
theonlyrao / first.js
Last active July 29, 2016 04:11
First attempt at render React component in new div
import React from 'react';
import ReactDOM from 'react-dom';
const Letter = React.createClass({
render() {
return (
// lots of HTML stuff here...
)
}
});
@theonlyrao
theonlyrao / ashwin-mock-assessment-submission.markdown
Last active August 3, 2016 20:08 — forked from rrgayhart/1602-mock-assessment-submission.markdown
ashwin-mock-assessment-submission.markdown

WebSockets Workshop (30 points)

Websockets Workshop

My Repo

I did not complete the code along. I was able to get a users previous vote to render on the page. I was also able to get the full tally of votes to be sent back to the user. However, I wasn't able to parse the returned aggregate vote information in a way that would let me render it on the page.

Since I could not get the aggregated vote information to display, I did not try to format it nicely.

@theonlyrao
theonlyrao / ashwin-require.md
Last active July 6, 2016 00:05
Ashwin Rao - The Concept of Require

Questions:

  • In the context of Node, what is a module?

A module is a fundamental Node building block that maps to a file. To expose the objects or methods contained in the module, i.e. another file, requires using module.exports in the module for anything that should be exposed, and to require the exported things in the file that wants to use them.

  • The code examples from the second blog post look very different from the first. Why?

I really hope it's because the second blog post is using RequireJS and all that syntax is sugar created by RequireJS in order to associate things inside the module with variables in other files.