Skip to content

Instantly share code, notes, and snippets.

View wchan2's full-sized avatar

Will Chan wchan2

View GitHub Profile
@wchan2
wchan2 / rspec.md
Last active August 29, 2015 14:02
Style Guides Collection

The RSpec Style Guide

This RSpec style guide recommends best practices so that real-world Ruby programmers can write code that can be maintained by other real-world Ruby programmers. A style guide that reflects real-world usage gets used, and a style guide that holds to an ideal that has been rejected by the people it is supposed to help risks not getting used at all – no matter how good it is.

The guide is separated into several sections of related rules. I've tried to add the rationale behind the rules (if it's omitted I've

@wchan2
wchan2 / .gitignore
Last active August 29, 2015 14:08
Gruntfiles
lib-cov
*.seed
*.log
*.csv
*.dat
*.out
*.pid
*.gz
*.pyc
@wchan2
wchan2 / fizzbuzz_dict.py
Last active August 29, 2015 14:10
Introduction to Programming in Python Workshop
def fizzbuzz(start, end):
i = start
fizzbuzz_dict = {
'five_three': [],
'five': [],
'three': []
}
while i <= end:
if i % 5 == 0 and i % 3 == 0:
fizzbuzz_dict['five_three'].append(i)
@wchan2
wchan2 / README.md
Last active August 29, 2015 14:10
Baruch PHP & MySQL Course

Baruch's PHP and MySQL Class Example Code

Due to a popular demand for object-oriented PHP, here are the examples that I covered in class.

Files included:

  • vehicle.php - a generic class that has properties and methods that any "vehicle" can extend
  • car.php - a car class that extends vehicle
  • test.php - requires vehicle.php and car.php and extends a series of statements with comments that represents what should be outputted

Credits:

@wchan2
wchan2 / .gitignore
Last active August 29, 2015 14:13
Go: Counting Artist Pairs
artist-pairs
@wchan2
wchan2 / .gitignore
Last active August 29, 2015 14:16
Simple Python Exercises
*.pyc
@wchan2
wchan2 / .gitignore
Last active August 29, 2015 14:24
Word Frequency Search
*.pyc
.DS_STORE
records.txt
queries.txt
@wchan2
wchan2 / .gitignore
Last active August 29, 2015 14:26
Custom Python HashMap
*.pyc
@wchan2
wchan2 / .gitignore
Last active August 29, 2015 14:26
Dictionary Tree
*.pyc
@wchan2
wchan2 / SelectiveWordCount.java
Last active September 13, 2015 05:57
Selective Word Count
import java.io.File;
import java.io.BufferedReader;
import java.io.FileReader;
import java.lang.reflect.Array;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.*;
public class MP1 {
Random generator;