Skip to content

Instantly share code, notes, and snippets.

View thefonso's full-sized avatar

thefonso thefonso

View GitHub Profile
@thefonso
thefonso / second_app_gemfile
Created January 31, 2014 16:19
gemfile for second app first video of rails in 20
source 'https://rubygems.org'
gem 'rails', '3.2.13'
group :development do
gem 'sqlite3'
end
group :production do
gem 'pg'

#Introduction

An introduction to curl using GitHub's API

#The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/thefonso
@thefonso
thefonso / file1.txt
Created October 14, 2014 23:47
Created via API
Demo

####Angular Testing Part-1

####Why do we test code...in an automated fashion.

Mark Ethan Trostler ( Google )..from Testable Javascript :

You have to write unit tests, so quit messing around and write some.

From the angular docs ( Many people at Google ):

JavaScript is a dynamically typed language which comes with great power of expression, but it also comes with almost no help from the compiler. For this reason we feel very strongly that any code written in JavaScript needs to come with a strong set of tests. We have built many features into Angular which makes testing your Angular applications easy. So there is no excuse for not testing.

@thefonso
thefonso / rails_helpers_2009.md
Created November 19, 2014 19:33
rails helper methods
Calling Helper Methods
Every helper method has its own set of parameters, and often it’s not clear from the documentation which parameters it will accept. How do you interpret the following?

label(object_name, method, text = nil, options = {})
The first few parameters at least take simple values. The object_name parameter will take a symbol pointing to an ActiveRecord object, like :person. The method parameter, though—what method does it take? It actually wants a symbol, say :name, for an attribute from the object specified in the previous parameter. Why would the Rails documentation call that a method? Because it’ll use a method to access the attribute.

The next parameter, text, is shown with its default value, nil. Any time you see a parameter listed as equal to something, that value is the default.

And options? What is options? It looks like lots of methods must have the same options, because they all have the same entry in the documentation, but it’s really just a convention. The actual options, na
<section id="todoapp">
<header id="header">
<h1>todos</h1>
<input type="text" id="new-todo" placeholder="What needs to be done?" />
</header>
<section id="main">
<ul id="todo-list">
<li class="completed">
<input type="checkbox" class="toggle">
@thefonso
thefonso / router.js
Last active August 29, 2015 14:10 — forked from bojicas/router.js
import Ember from 'ember';
var Router = Ember.Router.extend({
location: TodoEmberENV.locationType
});
Router.map(function() {
this.resource('todos', { path: '/' });
});
{{outlet}}
<footer id="info">
<p>Double-click to edit a todo</p>
</footer>
@thefonso
thefonso / index.hbs
Last active August 29, 2015 14:10 — forked from bojicas/index.hbs
<section id="todoapp">
<header id="header">
<h1>todos</h1>
<input type="text" id="new-todo" placeholder="What needs to be done?" />
</header>
<section id="main">
<ul id="todo-list">
<li class="completed">
<input type="checkbox" class="toggle">
Effectively Reviewing a Pull Request
====================================
How do they work?
-----------------
- code on a branch or fork
- open pull request
- have people review code
- potentially update the code
- merge pull request