Skip to content

Instantly share code, notes, and snippets.

View philipbroadway's full-sized avatar

Philip Broadway philipbroadway

View GitHub Profile
@philipbroadway
philipbroadway / quick_sort.rb
Created May 17, 2017 03:06
Quick Sort Module For Array
module QuickSort
module InstanceMethods
def swap(arr, a, b)
arr[a], arr[b] = arr[b], arr[a]
end
def partition(arr, left, right)
@philipbroadway
philipbroadway / Date.swift
Last active January 6, 2017 05:06
Swift 3 extension for calculating date differences
/*
Examples:
let startDate = Date()
let endDate = startDate.addingTimeInterval(3600 * 4)//Start + 4hrs
//Calculate +/- difference
startDate.offset(date: endDate) //4:00:00
endDate.offset(date: startDate) //-4:00:00
//Calculate only difference
@philipbroadway
philipbroadway / timesheet.markdown
Last active January 4, 2018 01:20
timesheet.markdown

Timesheet


Year

Month

Days - Days

User

Issue Estimated Actual
@philipbroadway
philipbroadway / lang.reference.template.markdown
Last active August 29, 2015 14:13
lang.reference.template

###Data Types

####Type A

Description A

Example A
@philipbroadway
philipbroadway / gist:5435860
Last active December 16, 2015 12:39
Postgres Cheat Sheet

#Postgres Cheat Sheet

###Destroy db

DROP DATABASE "DATEBASE_NAME";

###Create db

CREATE DATABASE "DATEBASE_NAME";