Skip to content

Instantly share code, notes, and snippets.

# SSL self signed localhost for rails start to finish, no red warnings.
# 1) Create your private key (any password will do, we remove it below)
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key

Strategy Pattern

The strategy pattern is useful for situations where it is necessary to dynamically swap the algorithms used in an application. The strategy pattern is intended to provide a means to define a family of algorithms, encapsulate each one as an object, and make them interchangeable. The strategy pattern lets the algorithms vary independently from clients that use them.

The Strategy Pattern consists of strategies, which are the interchangeable classes which encapsulate variants of a particular algorithm, and the context class, which utilizes these strategies. The context can choose different strategies at runtime depending on the situation.

Here is an example implementation of the Strategy Pattern:

API Reference

The Dev Bootcamp (DBc) API is designed on REST principles. Our approach entails simple, descriptive URLs used to obtain resources. We use HTTP features, such as the HTTP verb GET, HTTP Secure, and HTTP response codes for API errors. Successful API calls will result in JSON responses. Hopefully these engineering choices enable developers to maximize their productivity.

The Dev Bootcamp API allows authenticated users to access select data such as a student's social media urls, a cohort's Socrates submissions, or a Dev Bootcamp location's total number of students. This data can be used to create applications that leverage DBc info into useful creations limited only by a developer's imagination.

API Authentication and Authorization

The DBc API uses OAuth 2.0 through [DBc Auth](http

Mar 2nd, 2009

An efficient workflow for developers in Agile teams that handles features and bugs while keeping a clean and sane history.

At Hashrocket we use git both internally and in our Agile mentoring and training. Git gives us the flexibility to design a version control workflow that meets the needs of either a fully Agile team or a team

##Abraham Sangha, web developer

Email
Web
GitHub
Phone: 617.446.3630

###/Pro.file

I am an engineer in search of a junior web developer position.

@abrahamsangha
abrahamsangha / .bash_profile
Last active December 24, 2015 15:19
Bash profile
export PATH="/usr/local/bin:$PATH"
export PGHOST=localhost
export GIT_PS1_SHOWDIRTYSTATE=true
c_cyan=`tput setaf 6`
c_red=`tput setaf 1`
c_green=`tput setaf 2`
c_sgr0=`tput sgr0`
#------------------------------------------------------------
# GoToBilling Ruby on Rails Plugin v1.0
# Compatible with version 3.0.2 of the GoToBilling Gateway
#------------------------------------------------------------
require 'net/http'
require 'net/https'
require 'cgi'
module GoToBillingLibrary
Started GET "/" for 127.0.0.1 at 2014-03-25 14:07:33 -0500
Processing by SearchesController#index as HTML
Redirected to http://localhost:3001/users/auth/sso
Filter chain halted as :ensure_session rendered or redirected
Completed 302 Found in 0ms
Started GET "/users/auth/sso" for 127.0.0.1 at 2014-03-25 14:07:33 -0500
(sso) Request phase initiated.
@abrahamsangha
abrahamsangha / bootstrap_summary
Created May 12, 2014 22:23
bootstrap_summary
======= Bootstrap Summary =======
** Repo specific configuration **
harbard
- Successfully cloned repo
- Successfully added asset to repoman
- Problem running 'bundle check || bundle install'
- Successfully ran powder link
- Problem running bootstrap.sh
# O(n^2)
def dedupe(sorted_array)
previous_values = []
sorted_array.map do |element|
if previous_values.include? element
next
else
previous_values << element
element