Skip to content

Instantly share code, notes, and snippets.

View aliHafizji's full-sized avatar

Kauserali aliHafizji

View GitHub Profile
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
init() {
this._super();
var object = Ember.Object.create({ test: 'value.' });
console.log(object.get('test'));
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
- (void)searchDisplayController:(UISearchDisplayController *)controller willShowSearchResultsTableView:(UITableView *)tableView {
[tableView setBackgroundColor:[UIColor whiteColor]];
[tableView setSeparatorColor:kColorDivider];
}
- (void)searchDisplayController:(UISearchDisplayController *)controller didLoadSearchResultsTableView:(UITableView *)tableView {
tableView.rowHeight = self.tableView.rowHeight;
[tableView setTableFooterView:[self footerForTableView]];
}
//manually add a search bar
UISearchBar *searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 3, 320, 44)];
searchBar.delegate = self;
[searchBar setPlaceholder:NSLocalizedString(@"SearchNearbyPlaces", nil)];
UISearchDisplayController *searchDisplayController = [[UISearchDisplayController alloc] initWithSearchBar:searchBar contentsController:self.navigationController];
searchDisplayController.searchResultsDataSource = self;
searchDisplayController.searchResultsDelegate = self;
searchDisplayController.delegate = self;
- (void) rotateHandleWithTouch:(UITouch*)touch {
CGPoint previousLocation = [touch previousLocationInView:[touch view]];
CGPoint newLocation = [touch locationInView:[touch view]];
//preform all the same basic rig on both the current touch and previous touch
CGPoint previousGlLocation = [[CCDirector sharedDirector] convertToGL:previousLocation];
CGPoint newGlLocation = [[CCDirector sharedDirector] convertToGL:newLocation];
CCSprite *handle = (CCSprite*)[_spriteManager getChildByTag:HANDLE_TAG];
NSMutableDictionary *uploadHttpBody = @{@"filename":data}.mutableCopy;
MKNetworkOperation *uploadOperation = [[MKNetworkOperation alloc] initWithURLString:url params:uploadHttpBody httpMethod:@"PUT"];
<style name="Theme.cheddar" parent="@android:style/Theme.Holo.Light">
<item name="android:alertDialogTheme">@style/cheddar_AlertDialog</item>
</style>
<style name="cheddar_AlertDialog" parent="@android:style/Theme.Holo.Light.Dialog">
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:buttonBarButtonStyle">@style/cheddar_AlertButtonStyle</item>
</style>
<style name="cheddar_AlertButtonStyle" parent="@android:style/Holo.Light.ButtonBar.AlertDialog">
<style name="Theme.cheddar" parent="@android:style/Theme.Holo.Light">
<item name="android:dialogTheme">@style/cheddar_AlertDialog</item>
</style>
<style name="cheddar_AlertDialog" parent="@android:style/Theme.Holo.Dialog">
<item name="android:buttonBarStyle">@style/cheddar_AlertButtonStyle</item>
</style>
<style name="cheddar_AlertButtonStyle" parent="@android:style/Holo.ButtonBar.AlertDialog">
<item name="android:background">@drawable/selectable_background_cheddar</item>
<style name="Theme.cheddar" parent="@android:style/Theme.Holo.Light">
<item name="android:buttonStyle">@style/cheddar_ButtonStyle</item>
</style>
<style name="cheddar_ButtonStyle" parent="@android:style/Widget.Holo.Light.Button">
<item name="android:background">@drawable/selectable_background_cheddar</item>
</style>
<style name="Theme.cheddar" parent="@android:style/Theme.Holo.Light">
<item name="android:buttonStyle">@style/cheddar_ButtonStyle</item>
</style>
<style name="cheddar_ButtonStyle" parent="@android:style/Widget.Holo.Light.Button">
<item name="android:background">@drawable/selectable_background_cheddar</item>
</style>