Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View joshmfrankel's full-sized avatar
🇺🇦

Josh Frankel joshmfrankel

🇺🇦
View GitHub Profile
@rreinhardt9
rreinhardt9 / bsearch.rb
Created December 27, 2017 16:07
A Binary Search Implementation
class Bsearch
def initialize(dictionary)
@dictionary = Array(dictionary)
end
def search(value)
search_in_chunk(@dictionary, value)
end
@joshmfrankel
joshmfrankel / install.sh
Last active September 22, 2016 15:53
Linux: Install script
#!/bin/bash
# Add Repos
echo ""
echo "============================="
echo " Adding Third-party Repos "
echo "============================="
echo ""
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys BBEBDCB318AD50EC6865090613B00F1FD2C19886
@joshmfrankel
joshmfrankel / Fixes
Last active May 30, 2017 13:36
Linux: Install guide
# NFSD for vagrant
sudo apt-get install nfs-common nfs-kernel-server
# Mouse Flickering
# I had the same problem. You can fix it manually. Open System Settings > Displays. In the Displays window, you will see an Unknown monitor. Click it and disable it.
# libcrypt fix for spotify
https://launchpad.net/ubuntu/+archive/primary/+files/libgcrypt11_1.5.3-2ubuntu4.2_amd64.deb
# Fix login shell bug with gconf-editor
@PatrickJS
PatrickJS / factory-shared.es5.js
Last active January 6, 2024 04:18
Different examples of OOP "class" with "inheritance" done using JavaScript including languages that transpile into js. Take notice to the amount of boilerplate that's needed in ES5 compared to ES6. These examples all have the same interface with pros/cons for each pattern. If they seem similar that's whole point especially the difference between…
var EventEmitter = require('events').EventEmitter;
var _ = require('lodash');
// Factory shared
var makePerson = function() {
var person = {};
EventEmitter.call(person);
person.wallet = 0;
_.extend(person, personMethods)
return person;
@speric
speric / poodir-notes.md
Last active January 24, 2024 10:31
Notes From "Practical Object-Oriented Design In Ruby" by Sandi Metz

Chapter 1 - Object Oriented Design

The purpose of design is to allow you to do design later, and it's primary goal is to reduce the cost of change.

SOLID Design:

  • Single Responsibility Principle: a class should have only a single responsibility
  • Open-Closed Principle: Software entities should be open for extension, but closed for modification (inherit instead of modifying existing classes).
  • Liskov Substitution: Objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program.
  • Interface Segregation: Many client-specific interfaces are better than one general-purpose interface.
@Integralist
Integralist / rules for good testing.md
Last active February 26, 2024 21:23
Sandi Metz advice for writing tests

Rules for good testing

Look at the following image...

...it shows an object being tested.

You can't see inside the object. All you can do is send it messages. This is an important point to make because we should be "testing the interface, and NOT the implementation" - doing so will allow us to change the implementation without causing our tests to break.