Skip to content

Instantly share code, notes, and snippets.

View andrewdc92's full-sized avatar

Andrew Cordivari andrewdc92

View GitHub Profile
@andrewdc92
andrewdc92 / keybase.md
Created January 16, 2018 22:41
keybase.md

Keybase proof

I hereby claim:

  • I am andrewdc92 on github.
  • I am a_cord (https://keybase.io/a_cord) on keybase.
  • I have a public key ASDamh_W-qlvspTLbMpWudSS7Bda3rEzzNHStzl3m60Pfwo

To claim this, I am signing this object:

@andrewdc92
andrewdc92 / SSL_heaven_or_hell.md
Last active August 22, 2017 03:13
SSL Certificate Issues for Ruby, RVM, or Homebrew? (OSX/Unix)

Are you getting this dreaded message? openssl::ssl::sslerror: ssl_connect returned=1 errno=0 state=sslv3 read server certificate b: certificate verify failed

I will cut to the chase- if you're booting a rails server (rails s), initializing a new app (rails new xxxxx), or your rails server is running and then the logs show the above, don't be afraid! However, most resources are addressing a more surface-level issue that's nonspecific to Ruby. Most SO responses are addressing a documented SSL/Homebrew bug: after the heartbleed virus, Homebrew and Apple made it impossible to --force link openSSL to the native OSX SSL. In practicality and security reasons, this makes sense. But because Homebrew is a widely used package manager, it creates a few issues.

A few notes:

`openssl version -a` and `ruby -r openssl -e "puts OpenSSL::OPENSSL_VERSION"` should output a version higher than `1.0.0`, and will also display a path like `OPENSSLDIR: /usr/local/openssl-1.0.2h/ssl`

#What is RegEx?

Regular Expression was first implemented in the late 1950s. It is a string of characters that's used to identify patterns in strings of text. In fact, the string of characters is used to define an intended search pattern, and then search the targeted data string for the specified pattern. The find and replace search capabilities in most text editors is an example of a tool that utilizes pattern matching. Regular Expression initially had a strict definition related to the fundamentals of Unix text processing, but now a variety of languages have regex or regexp built in, which differs from the initial definition of a regular language and the modernized term frequently refers to a general system of pattern seeking and matching.

#Why is it useful?

Many of the basic processes of computing, leading up to morea advanced implementations like machine learning, are dependent on pattern recognition. Think about the popular algorithms we've recently covered. It is the predictabi

What is Stripe and how does it work?

Stripe is utilized to securely process and track financial transactions. The API does the bulk of the work but utilizing the Ruby gem (ruby binding) makes initialization and synchronization much easier. Binding is definitely a bit complicated of a concept to dive into, but in a nutshell it's related to scope and state initiation. The Stripe gem is useful is because it creates flexibility in the binding environment, so that financial transactions and user associations persist across a variety of different asynchronous actions. It also formats the serialization of parameters so that developers can focus on integration without worrying about custom-matching the parameters. As we've learned from a few previous examples, properly serializing data (especially private financial info) can be the difference between a secure site and compromising your user's info.

How to install the gem? Like most gems...

gem install stripe

Are there any requirements

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.
@andrewdc92
andrewdc92 / Ruby_Methods_and_Helpers.md
Last active July 26, 2017 17:25
Ruby Methods & Path Helpers

Similiar to Javascript, Ruby methods are used to "bundle one or more repeatable statements into a single unit"(tutorialspoint.com). I think of methods as the verbs- they provide functionality in an action that can be applied to different object types.

In Ruby, methods need to begin with a lowercase letter. Constants are set with a capital letters and you don't want the method to be interpreted as something else entirely.

Methods should be defined before calling them. In Ruby, use 'def'.

Example where a method is defined with a parameter.

def say(something)

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.
### 1) -check for all necessary CDNs
-initiate angular in html document body tag using the ng- app directive
2) Create the controller in JS, along with the controller function. Instead of using $scope, I prefer the view model format, which utlizes this.
angular
.module(‘name’, [ ])
.controller(‘RestaurantMenuController’, RestaurantMenuController);
function RestaurantMenuItemController( ) {
var vm = this;

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

  • Use appropriate iterator methods to declaratively loop through collections
  • Follow the order of execution in a program that uses callbacks
  • Write a higher-order function that calls a custom callback

###Objects