Skip to content

Instantly share code, notes, and snippets.

View DavidGinzberg's full-sized avatar

David Ginzberg DavidGinzberg

View GitHub Profile
@DavidGinzberg
DavidGinzberg / X_Oriented_Programming.md
Created January 18, 2015 12:47
A list of different kinds of "X Oriented Programming" Models
@DavidGinzberg
DavidGinzberg / AccessImage.md
Last active August 29, 2015 14:17
An idea for creating accessible images (for visually impaired users) which contain their own embedded descriptions

#Summary

Create and implement a standard for embedding descriptive information (intended for visually impaired users and those using browsers or internet connections which cannot support images) in images without relying on additional html content to accompany them. The key component of this is that the descriptive information is embedded directly in the image file (though perhaps can also be requested independent of the file for limited/headless browsers which do not support images). First-guess techniques for embedding the information would be exactly those used by criminals and terrorists to steganographically hide data inside otherwise benign images (eg: coercing low-order bits in jpegs)

#Techniques by File Format

Jpeg

  • Nothing here yet
@DavidGinzberg
DavidGinzberg / habit_setup.sh
Last active August 29, 2015 14:23
A setup script for running a habitrpg development environment on Google Cloud Compute
#!/bin/bash
print_status() {
echo
echo "## $1"
echo
}
print_status 'Fetching and running setup script for nodejs installation'
curl -sL https://deb.nodesource.com/setup | sudo bash -
@DavidGinzberg
DavidGinzberg / Car.java
Created September 30, 2015 04:44
Some badly written code to help learn and practice polymorphism concepts
// File: Car.java
// Author: David Ginzberg
// Purpose: A small metaphorical program for practicing polymorphic
// code design and using interfaces
package polymorphism;
public class Car{
private enum Model{
CIVIC, CHARGER, Z4, JETTA;
}
@DavidGinzberg
DavidGinzberg / PWSpec.md
Last active October 14, 2015 20:59
A specification for password validation rules to be implemented as a regex learning exercise

LMNOP Corp Password Validation Functional Requirement Document (FRD)

Purpose

The purpose of this document is to provide a specification of the technical requirements for enhancement LMNOP-15-04-0010: "Enhanced user password security rules". The business justification for this and other enhancements included in Enterprise Release LMNOP-15-04 can be found in ER1504-Business-Requirements-v3.0-revised-final-final.doc.

Current State

#HashTable exercise

In a new file create a hashtable mapping Strings to Integers

Add at least six values

print all the keys

print all the values

@DavidGinzberg
DavidGinzberg / Part1.md
Last active October 21, 2015 21:12
Building a basic database Table in Java

Part 1: A Simple Database Table

Create a Table class with three methods:

NOTE: for this exercise you only need to handle storing Strings in the Table; Modifying your finished Table class to handle columns with different data types is a good stretch assignment.

insert()

  • Takes 1 parameter: a record ( String->String key-value pairs; keys represent column names in the table and values are String values stored in each column)
  • Stores the records in a data structure in the Table class
@DavidGinzberg
DavidGinzberg / EmployeeFactoryLab.md
Created November 11, 2015 15:22
Design pattern labs

Factory Method pattern

Employee factory:

— Write an abstract Employee class with name, type, and payment attributes (and corresponding accessor functions).

  • Extend Employee with at least two child classes that represent types of employees (e.g.: salaried, hourly, contract, permanent, etc)
  • Create an EmployeeFactory class with a makeEmployee method that takes two Strings (employee name and employee type) and returns an Employee object constructed from the corresponding child class based on the type parameter.
@DavidGinzberg
DavidGinzberg / 1_FactoryLab.md
Last active November 16, 2015 20:54
Design pattern labs

Factory Method pattern

I: Employee factory:

  • Write an abstract Employee class with name, type, and payment attributes (and corresponding accessor functions).
  • Extend Employee with at least two child classes that represent types of employees (e.g.: salaried, hourly, contract, permanent, etc)
  • Create an EmployeeFactory class with a makeEmployee method that takes two Strings (employee name and employee type) and returns an Employee object constructed from the corresponding child class based on the type parameter.

II: Logger Factory

@DavidGinzberg
DavidGinzberg / IntelliJUpdatePatch.sh
Created May 22, 2016 19:24
Take ownership of IntelliJ app on OS X if it was originally installed by a different admin user (This allows you to update IntelliJ at will)
sudo chown -R `whoami` /Applications/Intelli*