Skip to content

Instantly share code, notes, and snippets.

View odennZero's full-sized avatar

Tom Maxwell odennZero

View GitHub Profile
@odennZero
odennZero / strategy-pattern-example.cs
Last active August 29, 2015 14:21
Strategy Pattern Example
public class Librarian {
// librarian sort strategy storage
protected ISortStrategy sortStrategy;
public void SetSortType(ISortStrategy sortStrategy) {
this.sortStrategy = sortStrategy;
}
public void SortBooks(List<Books> books) {
@odennZero
odennZero / cascade-pattern-example.cs
Last active August 29, 2015 14:21
C# Cascade Pattern Example
// extension methods require a static class container
public static class CascadeExtensions {
// use the keyword 'this' to create an extension function using the first parameter as the base type
public static List<string> AddItem(this List<string> source, string item) {
source.Add(item);
return source;
}
}
@odennZero
odennZero / 0_reuse_code.js
Last active August 29, 2015 14:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console

Sublime Text 3 – Useful Shortcuts (Mac OS X and Windows)

General

Mac Windows
⌘⌃P Ctrl P go to global
⌘R Ctrl R go to symbol (Ctrl P + @)
⌃G Ctrl G go to line (Ctrl P + :)
⌃; Ctrl ; go to term (Ctrl P + #)
⌘KB Ctrl K B toggle side bar