Skip to content

Instantly share code, notes, and snippets.

#Write our own indexOf utility method

String.prototype.indexOf = function(pattern) {
  for (var i = 0; i < this.length; i++) {
    var potentialMatch = this.substring(i, pattern.length + i);
    if (potentialMatch === pattern) {
      return i;
    }
  }
@serabakpak
serabakpak / lodash.md
Last active October 24, 2016 08:09
Lodash Lightning Talk

Lodash

What it is

Lodash is a library of Javascript functions that provides clean, performant methods for manipulating objects, arrays, numbers, strings, etc.

Why it's awesome

Lodash makes JS more like Ruby because it gives you a whole bunch of commonly used helper utility functions (so you don't have to write your own!!)

@serabakpak
serabakpak / pagination.md
Last active October 13, 2016 17:05
Adding Pagination to your Rails app using kaminari

Adding Pagination to your Rails app using kaminari

What it is

From their GitHub page: "A Scope & Engine based, clean, powerful, customizable and sophisticated paginator for modern web app frameworks and ORMs"

Why it's awesome

  • Easy to use
  • No configuration required
  • Don't have to define anything in your models or helpers.

Week 7 Learning Objectives

###Intro Ruby

  • List Ruby data types.
  • Articulate strategies to learn new programming languages and frameworks.
  • Run Ruby code in an interactive Command Line Interface or from a file.

###Ruby Methods

  • Write conditionals, loops, and methods in Ruby.
  • Apply methods in ruby to solve problems.

Week 8 Learning Objectives

###Migrations

  • Add and remove columns from the database.
  • Alter an existing column.
  • Explain when it is okay to edit a migration and when it is okay to edit the schema.

###Associations

  • Describe how relational databases can be used to create associations between resources.
@serabakpak
serabakpak / gist:fb488ca51c25feafcd9a7176472250e9
Last active September 16, 2016 15:26
How to build an Angular app from scratch

How to build an Angular app from scratch

  1. First, we're going to assume that we already have a basic html boilerplate set up. Make sure that Angular is downloaded and linked in our index.html above our application script (usually named app.js).
<!-- VENDOR SCRIPTS -->
<script src="/vendor/angular/angular.min.js"></script>

<!-- APPLICATION SCRIPTS -->

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

  • Draw the call stack of a program that uses callbacks
  • Write a first-order function that calls a custom callback
  • Use iterator methods to iterate through collections

###Objects

@serabakpak
serabakpak / week1-learning-objectives.md
Last active August 17, 2016 23:14
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