Skip to content

Instantly share code, notes, and snippets.

View SamDarbonne's full-sized avatar

Sam Darbonne SamDarbonne

  • San Carlos, CA
View GitHub Profile
@SamDarbonne
SamDarbonne / designer.html
Created November 17, 2016 21:16
designer
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<polymer-element name="my-element">
@SamDarbonne
SamDarbonne / designer.html
Created November 17, 2016 18:32
designer
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../paper-item/paper-item.html">
@SamDarbonne
SamDarbonne / nokogiri.md
Last active October 13, 2016 16:04
What is that nokogiri thing that makes rails take so long to set up?

Nokogiri parses and edits HTML documents. I have not been able to find out why Nokogiri takes to long to gem install but I believe Rails uses it to compile .erb files. You can use Nokogiri to read and modify HTML documents both locally and by grabbing them from URLs.

###This Line grabs the Nokogiri homepage and stores it as a Nokogiri document. Nokogiri documents are special and do many things that we won't go into

doc = Nokogiri::HTML(open('http://www.nokogiri.org/tutorials/installing_nokogiri.html'))

@SamDarbonne
SamDarbonne / Show_Pathing.md
Last active September 30, 2016 19:01
Individual resource pathing in Rails

For most paths in ruby, a helper will take care of the path with a simple call, e.g. new_donut_path or donuts_path. The exception to this is a path that is required to have an ID in it, such as 'donuts/:id'. For these it can be confusing how to use the ID in a path helper. With a standard link we would do something like "donuts/#{@donut._id}" but with a path helper we need to pass information into the method with a method argument. For a predefined ID it's as simple as donuts_path(7) but we generally don't have links going to predefined ID's, so we need to use an instance variable to include the ID of the resource item we are dealing with in our view. The simplest way to do this is with donuts_path(@donut._id) which harkens back to our traditional path that we started with.

#Creating an Angular.js app from scratch #don't read this it's probably bad advice

The first and most important thing to do when creating an angular app is to initialize your HTML page as an angular app, otherwise nothing else we do will have any meaningful effect. To do this we simply add ng-app to the base HTML element that we want to be our app. Generally this will be the html tag.

once our page is initialized as an angular app, it's time to actually do some work on the angular app. first we need to create a controller. It's a good idea to keep things modular by building the controller in a separate file. We'll call this exampleController.js. This means that our main javascript file will need to require our controller. Angular wants us to import our controller as a new name since we will be using a view model instead of $scope. General practice is to call "exampleController as exampleCtrl". Now we can hook the controller up to our HTMl document. Angular does this with the ng-controller html attribute. T

Week 5 Learning Objectives

###Big O

  • Articulate a set of steps to determine Big O complexity.
  • List the Big O complexities of some commonly-used patterns and algorithms.
  • Estimate the time or space efficiency of an algorithm using Big O notation.

###Bubble Sort

Week 3 Learning Objectives

###Express

  • Draw a diagram of the request response cycle with Nodejs and Express included and labeled
  • Describe the roles that Nodejs and Express play in building a server
  • Use npm to initialize a node project
  • Write a local web server to serve JSON and static assets with Express

###Params and Routes

Week 2 Learning Objectives

###Iterator Methods & Callbacks

  • Use appropriate iterator methods to declaratively loop through collections
  • Follow the order of execution in a program that uses callbacks
  • Write a higher-order function that calls a custom callback

###Objects

@SamDarbonne
SamDarbonne / week1-learning-objectives.md
Last active September 15, 2016 23:37
Week 1 Learning Objectives

Week 1 Learning Objectives

###Git & Github

  • Explain the uses of Git and GitHub for tracking their changes and collaborating on projects.
  • Draw a model of local, remote, and working copies of their repositories.
  • Write some code, commit the changes, and write a strong commit message.
  • Deploy first live website using gh-pages.

###HTML & CSS