Skip to content

Instantly share code, notes, and snippets.

// 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?!"
@sebabelmar
sebabelmar / gist:1b5b897589fe91467082
Last active August 29, 2015 14:01
Random Gangs Creator
FENCE_LIZARDS = [
"Adam Dziuk",
"Adam Ryssdal",
"Aki Suzuki",
"Allison Wong",
"Andra Lally",
"Anup Pradhan",
"CJ Jameson",
"Christiane Kammerl",
"Christopher Aubuchon",
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"},
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){
<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">
@sebabelmar
sebabelmar / Controller
Last active August 29, 2015 14:19
Ginny's p10
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
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) {

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)
def do_twice
yield
yield
end
# The basics
do_twice {puts "HOLA"}
def do_something_to_an_array (array)

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]