Skip to content

Instantly share code, notes, and snippets.

View pshushereba's full-sized avatar

Patrick Shushereba pshushereba

  • Launch by NTT Data
  • Redlands, California
  • 08:31 (UTC -07:00)
  • X @cpppatrick
View GitHub Profile

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

Keybase proof

I hereby claim:

  • I am pshushereba on github.
  • I am pshushereba (https://keybase.io/pshushereba) on keybase.
  • I have a public key ASCY62KYfAQDLHOaV65xgO02OkX-NuQl0QfCdkvnJnFDXwo

To claim this, I am signing this object:

@pshushereba
pshushereba / gist:c30905d17e4dfb40d408fa03b3619721
Last active July 17, 2020 00:45
Problem Solving Framework
UNDERSTAND THE PROBLEM
Can I restate the problem in my own words?
What are the inputs that go into the problem?
What are the outputs that should come from the solution to the problem?
Can the outputs be determined from the inputs? In other words, do I have enough information to solve the problem? (You may not be able to answer this question until you set about solving the problem. That's okay; it's still worth considering the question at this early stage.)
How should I label the important pieces of data that are a part of the problem?
EXPLORE EXAMPLES
User Stories?
Unit Tests?
// const fetchData = async () => {
// const result = await axios.get(
// proxy + url
// )
// setTrialData(result.data.FullStudiesResponse.FullStudies)
// }
// fetchData()
@pshushereba
pshushereba / gist:c4cb99654909710a7977f11288060c3c
Created April 26, 2019 16:11
4/25/19 - Box Model Lecture Notes
/* The Box Model */
.box {
background-color: aqua;
width: 400px;
/* TRBL */
padding: 75px;
/* padding-top: 10px;
padding-left: 10px;
padding-right: 10px;
padding-bottom: 10px; */
require 'rails_helper'
RSpec.describe King, type: :model do
describe 'valid_move?' do
it 'should allow a vertical-up move' do
game = FactoryGirl.create(:game)
king = King.new(game: game, current_row_index: 5, current_column_index: 5)
expect(king.valid_move?(6,5)).to eq true
end
it 'should allow a vertical-down move' do
@pshushereba
pshushereba / distance.rb
Created March 30, 2016 21:54
Distance method for Chess Application
def distance(destination_row, destination_col)
if self.vertical?(destination_row, destination_col)
return (destination_row - current_row_index).abs
elsif self.horizontal?(destination_row, destination_col)
return (destination_col - current_column_index).abs
elsif self.diagonal?(destination_row, destination_col)
return (destination_col - current_column_index).abs
# destination_col - current_row_index
else
puts "Invalid Input"
class LinkedListNode
attr_accessor :value, :next_node
def initialize(value, next_node=nil)
@value = value
@next_node = next_node
end
end
@pshushereba
pshushereba / linkedlist1
Created March 2, 2016 22:59
Setup for Linked List #1
class LinkedListNode
attr_accessor :value, :next_node
def initialize(value, next_node=nil)
@value = value
@next_node = next_node
end
def print_values(list_node)
if list_node
class Image
def initialize(image)
@image = image
end
#Iterate through @image input and identify which indices have a "1".
def identify
one_index = []