Instantly share code, notes, and snippets.

Yaprak Ayazoğlu ankakusu

View GitHub Profile
@ankakusu
ankakusu / test.service.ts
Last active Jan 31, 2018
Test Service defined for testing REST calls with HTTPClient library
View test.service.ts
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';
@Injectable()
export class TestService {
private testUrl = '/some/test/url';
constructor(private http: HttpClient) { }
@ankakusu
ankakusu / ViewController.m
Created Dec 19, 2013
Create and initialize the GMSMapView programmatically.
View ViewController.m
@interface ViewController ()
@property (nonatomic) GMSMapView *mapView;
@end
@implementation ViewController
#pragma mark - UIViewController
- (void)viewDidLoad {
@ankakusu
ankakusu / postWrapper.m
Last active Dec 31, 2015
AFNetworking post wrapper
View postWrapper.m
-(void) get:(NSString *)rest withParams:(NSDictionary*)params
completion:(void (^)(id))completionBlock
{
NSString *curUrl = [self.constant.url stringByAppendingString:rest];
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
@ankakusu
ankakusu / pauseEvent
Created Nov 23, 2012
cordova location tracker at background
View pauseEvent
document.addEventListener("pause", App.pauseEvent, false);
pauseEvent: function(){
navigator.geolocation.watchPosition(
function(pos){
App.latlngs.push(new L.LatLng(pos.coords.latitude, pos.coords.longitude));
},
function(err){
alert('Error:' + err);
},
@ankakusu
ankakusu / 1question.txt
Created Sep 28, 2012
node.js - mongoose - while sending a data from client to server with ajax-post request
View 1question.txt
Hi,
I'm trying to send a mongodb schema from client to the server. I put the server (server.js) and client (client.js) codes above. When I press the button on the client side, I log the incoming data into the console.
In the console output what I have is:
{
field1: `container field`,
subSchema: []
}