Skip to content

Instantly share code, notes, and snippets.

{
“endpoint”: “return_premium_loan_adjustment/“,
“request”: {
“return_premium”: 10500,
“first_due_date”: “2018-09-04T01:00:00.000Z”,
“agency”: {
“days_after_effective_to_pay”: 20,
“fund_to_market”: true,
“payments_received_before_paying_compensation”: 3,
“days_before_compensation_is_payable”: 60
const myData = {};
const id = '1862e2570ed941f89e1eb5ae152df2bd';
let url = `http://10.0.0.133:5000/status?cli=True&id=01671c4f4fe54be0bd544e2343d7fd83`;
const params = `?cli=True&id=${id}`
$( document ).ready(() => {
myData.someCount = 0;
$('#count').text(myData.someCount);

STARTING A NEW THING

git checkout -b <name-of-branch>

do some work git commit -am "<some message about the new commit>"

do some more work git commit -am "<some message about the new commit>"

git push origin # can tab complete the name of branch

require 'delegate'
module Queries
class SomeQuery < SimpleDelegator
def initialize
super query_hash
end
private
class Hash
def deep_clone
Marshal.load(Marshal.dump(self))
end
def compact
self.select { |_, value| !value.nil? }
end
@pdougall1
pdougall1 / gist:a8b1206758aab172509c
Created November 9, 2015 00:24
refactoring flow
╔═════════════════╗ ┌─────┐ ╔═══════════════════╗
║ ║ │ YES │ ║ Make the intended ║
───────▶║ Is it open? ╠──┴─────┴──────▶║ change. ║
▲ ║ ║ ▲ ║ ║
│ ╚═════════╦═══════╝ │ ╚═══════════════════╝
│ │ │
│ ┌────┤ │
│ │ NO │ │
│ └────┤ │
│ │ │
@pdougall1
pdougall1 / gist:e79fee71e3997fe13f09
Last active November 3, 2015 20:16
POODR class notes (day 2)

Code smells, get really good at code smell (brown bag)

All you have to know is the codes smells

make a million new things > mutate objects

Forwardable (delegation)

Don't go on a virtical tangent, instead tiptoe away and finish the horizontal refactor

@pdougall1
pdougall1 / gist:451e723c59c44e45e02a
Last active November 3, 2015 20:16
POODR class notes

Notes and observations

  • The next one to prove the first is wrong
  • Choose a name inline with the concept in the domain.
    • Good OO code names concepts, not worried about implementation
  • Terseness is cleverness (not goodness), stop picking on each other for being simple.
  • Smallest change you can make to prove the last test insuficient.
  • Solve the easy problems first, then maybe the hard ones become easy.
  • DRY is good, but sometimes duplication makes sense, if it passes the inebriation test, check it in and walk away
  • Open/Close Add new features without adding new code
  • lean on the green

Things We need to do

  • Sign in to DealShield http://dealshield.net/users/sign_in
  • Setup ssh config with human readable names
  • Dig into and document how to look into the logging
  • Document problems with VCR testing. If a VCR test fails the rest of the VCR tests will also fail because a failing VCR test will not allow the recording to be ejected, and therefor will not allow another to be added.
@pdougall1
pdougall1 / gist:5f34d689d96d8066d733
Last active August 29, 2015 14:21
setting up local environment

Setting up my local environment

basics

instll homebrew

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

use iTerm

I think we need to just go download it