Skip to content

Instantly share code, notes, and snippets.

View Sebastian Belmar & Chirs Aubuchon: GPS 1.2
// GPS 1.2 - JavaScript
// YOUR FULL NAMES:
// 1.Sebastian Belmar
// 2.Christopher Lee Aubuchon
//Objectives create the objects, name the variables, pass the test, show the variables.
// 1. "YOU SIGNED... WHO?!"
View gist:1b5b897589fe91467082
FENCE_LIZARDS = [
"Adam Dziuk",
"Adam Ryssdal",
"Aki Suzuki",
"Allison Wong",
"Andra Lally",
"Anup Pradhan",
"CJ Jameson",
"Christiane Kammerl",
"Christopher Aubuchon",
View gist:ccc61b625355a4771e21
COHORT_LIST = [
{name: "Adam Dziuk", cellphone_number: "+19992223344"},
{name: "Adam Ryssdal", cellphone_number: "+19992223344"},
{name: "Aki Suzuki", cellphone_number: "+19992223344"},
{name: "Allison Wong", cellphone_number: "+19992223344"},
{name: "Andra Lally", cellphone_number: "+19992223344"},
{name: "Anup Pradhan", cellphone_number: "+19992223344"},
{name: "CJ Jameson", cellphone_number: "+19992223344"},
{name: "Christiane Kammerl", cellphone_number: "+19992223344"},
{name: "Christopher Aubuchon", cellphone_number: "+19992223344"},
View APICALLS
var request = require('request');
getCategories = function() {
request({
uri: "https://api.scalablepress.com/v2/products/anvil-100-cotton-t-shirt",
method: "GET",
timeout: 10000,
followRedirect: true,
maxRedirects: 10,
}, function(err, response, body){
View gist:e67fe78a9aa88b86f584
<html>
<head>
<title> Visualize Your Demographics</title>
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
</head>
<body>
<p class="display_text">Other pigglets voted:</p>
<div class="agedisplay">
<div class="infobox">
View Controller
post '/texts' do
# join the date and time to one field
# create instance of text using incoming data
# Saving date time as UNIX value in the database.
# In the data base this value is am integer, I changed the migration.
# Not using fancy Chronic just plain Time class on ruby
# get rid og Chronic from the gem file.
# to convert it back to date use Time.at(UNIX_VALUE)
# Try to use save instead of create and put and if statement... we can work on this when rails comes along. but look into it :D
View API test
require 'rails_helper'
RSpec.describe TagsetsController, type: :controller do
let(:json) { JSON.parse(response.body) }
# This should return the minimal set of attributes required to create a valid
# Tagset. As you add validations to Tagset, be sure to
# adjust the attributes here as well.
let(:valid_attributes) {
View using_yield.rb
def do_twice
yield
yield
end
# The basics
do_twice {puts "HOLA"}
def do_something_to_an_array (array)
View Phase-2_Strategies_and_Resouces.md

Phase 2 onboarding talk - Take-Aways

As a student it would be really good for me to have, control and understand "Sandboxes" to play with DB-AR; Client-Server sides; HTTP Request-Response. Ex. Sinatra skeleton (or simple Sinatra file) + using AR in console + reading server logs + how to print info in the server + break points on browser + network traffic. Postman.

Overview and topics to extend

  • Phase-1 was testing waters, Phase-2 is jumping off the cliff into the water.
  • Cohorts can become knowledge seekers or knowledge 'consumers' the teachers attitude might help developing one character or the other but mostly some strong personalities in the cohort might set the tone. (A)
  • It might be ideal to be able to allocate time and resources on the ~5% that needs personalized attention and keep providing a challenging environment to the rest of the students. (B)
  • Identify when there is a need to approach a topic inductively or deductively and what tools I have as a teacher to do so. (C)
View phase-2-sinatra.md

Ain't she sweet?!

Database Level

The skeletton that we used today has a connection on config/database.rb to a posgress DB if there is not set by ENV variable:

db = URI.parse(ENV['DATABASE_URL'] || "postgres://localhost/#{APP_NAME}_#{Sinatra::Application.environment}")

In that same file you can see that we set:

DB_NAME = db.path[1..-1]