This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="import" href="../../bower_components/polymer/polymer.html"> | |
<link rel="import" href="../../bower_components/iron-selector/iron-selectable.html"> | |
<dom-module id="my-element"> | |
<template> | |
<style> | |
:host { | |
display: block; | |
} | |
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var app = angular.module('Myapp' [ | |
]) | |
.factory ('Foo' , function(MyServiceThatUsesHTTP){ | |
var userDetails = {}; | |
userDetails.setToken(aToken){ | |
this.token = aToken; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.alos; | |
public class Dog { | |
private String name; | |
public Dog(String aName) { | |
this.name = aName; | |
} | |
public String getName() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sexLabel = [[CPTextField alloc] initWithFrame: CGRectMake(40, 430, 100, 30)]; | |
[sexLabel setStringValue:"Sex:"]; | |
[sexLabel setTextColor: [CPColor colorWithHexString:"FFFFFF"]]; | |
[sexLabel sizeToFit]; | |
[self addSubview:sexLabel]; | |
maleRadioButton = [CPRadio radioWithTitle: "Male"]; | |
femaleRadioButton = [CPRadio radioWithTitle: "Female"]; | |
otherRadioButton = [CPRadio radioWithTitle: "Other"]; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (BOOL)tabView:(CPTabView)tabView shouldSelectTabViewItem:(CPTabViewItem )tabViewItem{ | |
if([tabViewItem identifier] == "AddCharacterTabViewItem"){ | |
tabCounter ++; | |
CPLog.trace("Tabview was add character, returning no"); | |
var newCharacterSheetView = [[CharacterSheetView alloc] initWithFrame:CPRectMakeZero()]; | |
var newCharacterViewTab = [[CPTabViewItem alloc] initWithIdentifier: tabCounter]; | |
[newCharacterViewTab setLabel: @"New Character"]; | |
[newCharacterViewTab setView: newCharacterSheetView]; | |
[characterTabs insertTabViewItem: newCharacterViewTab atIndex: tabCounter]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.FilteredItemListView = Backbone.View.extend({ | |
initialize : function(options) { | |
console.log("Initializing filtered item list view"); | |
this.collection = options.itemCollection; | |
this.filter = options.filter; | |
this.collection.bind("reset", this.render, this); | |
this.render(); | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation MyTabPrototype : TNTabItemPrototype { | |
} | |
+ (void)initialize{ | |
TNTabViewTabButtonColorNormal = [CPColor colorWithPatternImage:[[CPThreePartImage alloc] initWithImageSlices:[ | |
[[CPImage alloc] initWithContentsOfFile:@"Resources/tabitem-normal-leftx.png" size:CPSizeMake(9, 22)], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSError *error; | |
audioPlayer = [[[AVAudioPlayer alloc] initWithContentsOfURL:audioFileURL error: &error] autorelease]; | |
audioPlayer.numberOfLoops = -1; | |
audioPlayer.delegate = self; | |
audioPlayer.volume = 1.0; | |
if (audioPlayer == nil) | |
NSLog(@"%@", [error description]); | |
else | |
{ | |
BOOL ready = [audioPlayer prepareToPlay]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { | |
NSLog(@"Touched page 1!"); | |
UITouch *touch = [touches anyObject]; | |
CGPoint location = [touch locationInView: self]; | |
CGRect previousButtonFrame = [previousButton frame]; | |
NSLog(@" %f, %f", location.x, location.y); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(void) slideView:(UIView *)uiv_slide toReveal:(UIView *)uiv_reveal withDuration:(double)d_duration { | |
//Bring the view to slide to the front | |
[self.view bringSubviewToFront:uiv_slide]; | |
//Add the subview to the ViewController's view | |
[self.view addSubview:uiv_reveal]; | |
//Make an animation to slide the view off the screen | |
[UIView animateWithDuration:d_duration |
NewerOlder