- By Edmond Lau
- Highly Recommended 👍
- http://www.theeffectiveengineer.com/
- They are the people who get things done. Effective Engineers produce results.
| // Create a function that holds another function which will "create" a name | |
| function init(){ | |
| // Global variable inside the function to be used after initialization | |
| firstName = "FIRST NAME" | |
| // Second function is what returns the global variable | |
| function createName(n){ | |
| return n | |
| } | |
| return createName(firstName); | |
| } |
| class BillsController < ApplicationController | |
| LEGISCAN_URL = 'https://api.legiscan.com/?key=' | |
| LEGISCAN_STATE_SEARCH = 'op=getMasterList&state=' | |
| LEGISCAN_STATE_API_CALL = LEGISCAN_URL + LEGISCAN_API_KEY + LEGISCAN_STATE_SEARCH | |
| def show | |
| //ERROR RETUNS NIL ON IMPLICIT STRING CONVERSION FOR API KEY ABOVE | |
| @bill_api = JSON.parse(HTTParty.get('https://api.legiscan.com/?key=77f939393jfjfdcb&op=getBill&id=' + params[:id]).body) | |
| end |
| <%= form_for([@post, @comment]) do |f| %> | |
| <% if @comment.errors.any? %> | |
| <div id="error_explanation"> | |
| <h2><%= pluralize(@comment.errors.count, "error") %> prohibited this comment from being saved:</h2> | |
| <ul> | |
| <% @comment.errors.full_messages.each do |message| %> | |
| <li><%= message %></li> | |
| <% end %> | |
| </ul> |
| class Comment | |
| include Neo4j::ActiveNode | |
| property :name, type: String | |
| property :content, type: String | |
| has_one :out, :post, type: :post | |
| has_one :in, :post, rel_class: :AgreeComment | |
| has_one :in, :post, rel_class: :DisagreeComment | |
| end |
| private | |
| # Use callbacks to share common setup or constraints between actions. | |
| def set_statement | |
| @statement = Statement.find(params[:id]) | |
| end | |
| def set_article | |
| @article = Article.find(params[:article_id]) | |
| end | |
| # Never trust parameters from the scary internet, only allow the white list through. | |
| def statement_params |
| render: function () { | |
| return ( | |
| <div bsClass="container-fluid"> | |
| <div bsClass="row-fluid"> | |
| <div className="email-box"> | |
| <EmailList emails={ this.state.emails } /> | |
| <hr /> | |
| <h2>Add a Email:</h2> | |
| <EmailForm form={ this.state.form } onEmailSubmit={ this.handleEmailSubmit } /> | |
| </div> |
| /* Supporting */ | |
| .supporting { | |
| background-color: #1c1c1c; | |
| text-align: center; | |
| padding: 50px 0 80px; | |
| } | |
| .supporting .col { | |
| float: left; | |
| width: 28%; |
| https://www.homechef.com/meals/steak-wellington | |
| https://www.homechef.com/meals/adobo-chicken-enchiladas | |
| https://www.homechef.com/meals/brown-butter-shrimp | |
| https://www.homechef.com/meals/umami-burger | |
| https://www.homechef.com/meals/barramundi-beurre-blanc | |
| https://www.homechef.com/meals/acapulco-steak-tacos | |
| https://www.homechef.com/meals/sirloin-steak-pad-thai | |
| https://www.homechef.com/meals/baked-french-onion-penne | |
| https://www.homechef.com/meals/wood-fired-bbq-chicken-pizza | |
| https://www.homechef.com/meals/new-england-cod-chowder |
| "Beef Demi-Glace => 10, | |
| "Green Onions => 10, | |
| "Red Onion => 11, | |
| "Heavy Whipping Cream => 12, | |
| "Cremini Mushrooms => 12, | |
| "Sirloin Steaks => 16, | |
| "Shallot => 17, | |
| "Boneless Skinless Chicken Breasts => 21, | |
| "Garlic Cloves => 27, | |
| "Butter => 28 |