Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A collection of motivational programs.
Objective-C
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
PourSomeSugarOnMe
ReleaseYourInhibitions
.gitignore
README.md

README.md

Motivational Code endorse

This repository is a collection of motivational programs. Each one is a fully working program that also delivers an uplifting message.


ReleaseYourInhibitions

Release Your Inhibitions

for (int i = 0; i <= inhibitions_.count - value; ++i) {
    Inhibition *inhibition = [[inhibitions_ lastObject] retain];
    [inhibitions_ removeLastObject];
    [inhibition release];
}

Pour Some Sugar On Me

Pour Some Sugar On Me

// PourSugarViewController.m
- (IBAction)onPourSomeSugarOnMeButtonTap:(UIButton *)sender {
    [[NSDefLeppard defaultLeppard] pourSomeSugarOn:self.me];
}

// NSDefLeppard.m
- (void)pourSomeSugarOn:(Person *)person {
    if ([person conformsToProtocol:@protocol(TakesSugar)]) { // Do you take sugar?
        [person prepareForSugar];
        switch (person.sugarPreference) {
            case SugarPreferenceOneLump: // One lump
                [person takeSugar:1];
                break;
            case SugarPreferenceTwoLumps: // or two?
                [person takeSugar:2];
                break;
            default:
                @throw [NSException exceptionWithName:NSInternalInconsistencyException
                                               reason:@"Do you take sugar? One lump or two?"
                                             userInfo:nil];
                break;
        }
    }
}

Contributing

Please fork and submit a pull request with your inspirational, working code! You will be granted push rights to the repo after your first commit is merged.

Some ground rules:

  • The code must function. No psuedocode.
  • Each program should be placed in its own folder in the root directory of the repository.
  • Or add your uplifting project as a submodule. Those rock.
  • Any language is acceptable.
  • In addition to the code, add a screenshot or snippet to the README that showcases the key point of your stirring script.
Something went wrong with that request. Please try again.