Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am lingtran on github.
  • I am lingtran (https://keybase.io/lingtran) on keybase.
  • I have a public key ASAYCB3_6zXHNC6RMljYJtJFHjn3MIyYA4_7ZpwrmZi6iQo

To claim this, I am signing this object:

  • Which sections were interesting?

    • Appreciate the summary via Nature of JS
    • Found concepts of 'freezing' code, closure, pure functions and recursion in Eloquent JS as ideas I would like to dive more deeply into understanding. But am aware this comes with time and practice.
    • Now that we've done Idea Box, I found myself re-reading the sections on binding and apply (EJS Ch5), and getters and setters (EJS Ch6). I recall finding the content powerful, but didn't process it deeply enough to try leveraging this information while implementing Idea Box. However, now that I'm more aware, I look forward to applying this knowledge towards upcoming projects!
  • Which sections did you totally skim?

  • The list of higher-order functions that are also available in Ruby.

  • Drawing a table in EJS Ch6 because I found their explanations confusing and so got totally lost. It was difficult to engage with the material when perplexed.

  • Do you think the reading was valuable?

Seize the 'vuja de'

My first lightning talk this module was titled "Seize the 'vuja de'". 'Deja vu' is about experiencing something new as if it were a familiar experience. 'Vuja de' is its inverse. And to seize the 'vuja de' gets at intentionally approaching something familiar in a brand new way. The example I used as something familiar was the emotional management of fear/anxiety/doubt. And the techniques for grappling with these familiar demons were ideas pulled from a chapter of a recently published book entitled "Originals: How Non-conformists Move the World," written by an organizational psychologist named Adam Grant. Since I gave this lightning talk during week five, which is in the middle of final projects and precedes final assessments, I wanted to talk about coping mechanisms that can enhance, rather than derail, performance under pressure.

I decided on this topic after stumbling upon Grant's [TED talk](https:/

Asset Pipeline Scavenger Hunt

What does it mean to concatenate files? Find an image of an example concatenated file. Why would we want to concatenate files?

  • To append one file to another
  • Merge data of one file with another (or multiple other files)
  • Example image: http://i.stack.imgur.com/eaepe.png (something like this?)
  • Intention for file concatenation: Minimize the number of requests made to the server, therefore optimizing client-side performance (such as enabling faster page load time)

What does it mean to precompile files? What does this have to do with coffeescript and sass files?

  • Specifies what files are to be processed by the asset pipeline

Seize the 'vuja de'

antonym: déjà vu

Context for selecting the topic

  • We're almost done with this module!!!!!!!!!!!!

A look at habits of 'original thinkers'

  • "Originals: How Non-conformists Move the World", by: Adam Grant
  • Behaviors that enable looking at the familiar and experiencing it as if it was the first time

Git commands & what they do

  • git stash

    • Stashes away dirty working directory in order to return to a clean working directory, when there is the desire to record the current state of the working directory and the index before going back to a clean working directory. The command saves your local modifications away and reverts the working directory to match the HEAD commit.
    • 'save' is default --> so, really git stash save if want to be explicit
    • Resource: https://git-scm.com/docs/git-stash
  • git stash apply

    • Restores modifications that were stored away
  • Beware that it may potentially be restored on top of a different commit

## Models, Databases, Relationships in Rails
#### What is the difference between a primary key and a foreign key? Where would we find a primary key? What would it be called by default? Where would we find a foreign key? What is the naming convention for a foreign key?
Primary key is a unique identifier in Tables. It can exist as a foreign key in AnotherTables or other tables with which it has a relationship. "id" - default name. "table_id" in AnotherTables.
#### Write down one example of:
* a `one-to-one `relationship: (current democratic society enables) one country has one president
* a `one-to-many relationship': one country has many citizens
* a `many-to-many relationship`: (given current industrial agricultural norms...I assume...) each agricultural crop has many producers, each producer has many agricultural crops

Week of April 4 Crypto Currency After School Sessions

In preparation for the hackathon this week I have been trying to revive our in-house cryptocurrency project, AKA ClarkeCoin

4:15 - 5:15 Each Day

Monday - Technical Fundamentals -- Hashing Algorithms and Public/Private Key Encryption

  • What are the core technical tools that make a blockchain-based system work?
  • What is a hashing algorithm?
@lingtran
lingtran / cfu_crud_in_sinatra.markdown
Last active March 23, 2016 04:24 — forked from rwarbelow/cfu_crud_in_sinatra.markdown
CRUD in Sinatra -- Check for Understanding
  1. Define CRUD.
  • Create. Read. Update. Delete.
  • CRUD references the types of functions/verbs that exist in a database.
  1. There are seven verb + path combinations that are necessary in a basic Sinatra app in order to provide full CRUD functionality. List each of the seven combinations, and explain what each is for.
  • specific to the Task Manager app...
  • read -> '/tasks' -> see all tasks, render :index view
  • read -> '/tasks/#{id}' -> see single task with specific task id, render :show view
  • create -> '/tasks/new' -> see form to input task info, render :new view
  • create -> '/tasks' -> submit task to be saved, redirect to '/tasks/#{id}' or '/tasks' (design decision)
  • update -> '/tasks/#{id}/edit' -> see form to edit task info, render :edit view

Introduction to Sinatra

1. What is the purpose of the server file (routing)?

It is the gatekeeper of the application. It's the first response in the request/response chain. It takes information from a request, parses it and then executes to plan depending on the HTTP verb, which determines what the client gets back.

2. How do you pass variables into the views?

Either as instance variable or local variables within the verb block. If local variable, utilize :locals, paired with view erb file/variable.

Ex: Instance Variable