Skip to content

Instantly share code, notes, and snippets.

Glenn Espinosa gxespino

Block or report user

Report or block gxespino

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View q3.cpp
#include <iostream>
#include <cmath>
using namespace std;
class QuadraticCalculator {
public:
string numberOfSolutions();
void printSolutions();
View Effective Ruby - Collections.md

Collections

ITEM: 16: Duplicate Collections Passed as Arguments Before Mutating Them

When inserting objects into collections or passing as parameters to methods, most are passed as reference, Fixnum are passed as value.

  • Consider adding a ! to methods that will change the parameters.
  • Consider using Array#reject instea of Array#delete_if.
class Tuner
  def initialize (presets)
    @presets = presets
    clean
View pdfer.rb
require 'pdf_forms'
require 'cliver'
input_data = {
ssn: '123-23-1234',
birthday: '02/14/1980',
color: 'Excella Red',
first_name: 'John Smith'
}
View functional-ruby-notes.md

Functional Ruby - Notes

  • immutable (don't modify inputs)
  • prefer stateless objects

Prevent access to initial state

class UserQuery
  def initialize(query)
    @query = query
View superdark.json
{
"Thin Strokes" : 2,
"Working Directory" : "\/Users\/gpespn",
"Prompt Before Closing 2" : 0,
"Selected Text Color" : {
"Green Component" : 0.6352941393852234,
"Blue Component" : 0.6980392336845398,
"Red Component" : 0.6078431606292725
},
"Rows" : 25,
View design_patterns.md

Day #1

Discussed:

  • Concerns/Mixins vs. Explicit classes for business logic
    • Cons for Concerns:
      • Concern will grow in responsibility and behavior
      • Concerns across repos are hard to manage
      • "floating" methods are implicit
      • Poor naming standards across teams. The behavior encompassed in a concern is not explicit. e.g. CaseStatusConcern could be improved by CaseStatusFetchable
    • Pros for Concerns:
View ResponderMobileApplication.md

Responder Mobile Application Features

MVP - Initial release

  • Sign in/Sign up
  • Claim
  • Unclaim
  • Reassign
  • Mute conversations
  • Close issue/conversation
View checkout-ch-2.rb
class CheckoutMachine
PRODUCT_LIST = {
123 => { product: :chips, price: 200 },
456 => { product: :salsa, price: 100 },
789 => { product: :wine, price: 1000 },
111 => { product: :cigarettes, price: 550 },
000 => { product: :bonus_card, price: nil }
}
def initialize
View ActiveRecord CheatSheet
ActiveRecord cheat sheet / EXAMPLES
INSTALL
=======
$ gem install activerecord
in GEMFILE: gem ‘activerecord’
REQUIRE
=======
require ‘active_record’
@gxespino
gxespino / .rspec
Created Jul 23, 2015
Analyzing Shakespeare
View .rspec
--color
--require spec_helper
--format documentation
You can’t perform that action at this time.