#Generate cities data
wget http://download.geonames.org/export/dump/cities15000.zipunzip cities15000.zipnode geonames.js cities15000.txt
The result is json array of cities in the following format:
{
_id:
| // | |
| // UIWebView+TrueHeight.h | |
| // RAWebViewTrueHeight | |
| // | |
| // Created by Stephen Keep on 08/03/2013. | |
| // Copyright (c) 2013 Stephen Keep. All rights reserved. | |
| // | |
| #import <Foundation/Foundation.h> |
| - (void) viewDidAppear:(BOOL)animated { | |
| [super viewDidAppear:animated]; | |
| [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientationChanged:) name:@"UIDeviceOrientationDidChangeNotification" object: nil]; | |
| } | |
| -(void)viewDidDisappear:(BOOL)animated { | |
| [super viewDidDisappear:animated]; | |
| [[NSNotificationCenter defaultCenter] removeObserver:self name:@"UIDeviceOrientationDidChangeNotification" object:nil]; | |
| } |
| #define DATA(str) [(NSString*)(str) dataUsingEncoding:NSUTF8StringEncoding] | |
| - (NSData *)generateFormData:(NSDictionary *)dictionary boundary:(NSString *)boundary { | |
| NSMutableData *data = [[NSMutableData alloc] init]; | |
| id key; | |
| NSEnumerator *enumerator = [dictionary keyEnumerator]; | |
| while (key = [enumerator nextObject]) { | |
| id value = [dictionary valueForKey:key]; | |
| [data appendData:DATA(([NSString stringWithFormat:@"--%@\r\n", boundary]))]; |
| -(void)AppendExisting:(NSString*)val | |
| { | |
| @synchronized (val) { | |
| [oldValue stringByAppendingFormat:@"-%@",val]; | |
| } | |
| } |
| typedef enum: NSInteger { | |
| NSOperationQueuePriorityNormal = 0; | |
| NSOperationQueuePriorityHigh = 4; | |
| } NSOperationQueuePriority; |
| //ios6 | |
| SString *UUID = [[NSUUID UUID] UUIDString]; | |
| //ios5 | |
| - (BOOL)application:(UIApplication *)application | |
| didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
| { | |
| NSString *UUID = [[NSUserDefaults standardUserDefaults] objectForKey:kApplicationUUIDKey]; |
| //set environment variable | |
| heroku config:set API_URL='<URL HERE>' --app <APP NAME> | |
| //Database dump | |
| heroku pgbackups:capture | |
| curl -o latest.dump `heroku pgbackups:url` | |
| //Restore locally | |
| pg_restore --verbose --clean --no-acl --no-owner -h localhost -U myuser -d mydb latest.dump |
#Generate cities data
wget http://download.geonames.org/export/dump/cities15000.zipunzip cities15000.zipnode geonames.js cities15000.txtThe result is json array of cities in the following format:
{
_id:
Forked from 14islands's Pen Basic Web Animations Tween.
A Pen by Captain Anonymous on CodePen.
| [{"id":"eb5f1784.14a0e8","type":"onthedot-connection","z":"4dc47816.b23b88","name":"Red Ant","api_url":"https://sbapi.onthedot.com/api/v1.0","api_key":"1dOHtajAxKpCP0kLnc6BKMI6ZeQa"},{"id":"4a99916a.b5667","type":"onthedot-delete-booking","z":"4dc47816.b23b88","creds":"eb5f1784.14a0e8","name":"","store_id":"","order_id":"","x":382.5,"y":456,"wires":[["c7e807ad.3817f8"]]},{"id":"d3c8273f.2c37d8","type":"inject","z":"4dc47816.b23b88","name":"","topic":"","payload":"{\"order_id\":\"17450353\",\"store_id\":\"RedAnt-01\"}","payloadType":"json","repeat":"","crontab":"","once":false,"x":92,"y":378,"wires":[["3fe83871.c017c8"]]},{"id":"c7e807ad.3817f8","type":"debug","z":"4dc47816.b23b88","name":"","active":true,"console":"false","complete":"false","x":563,"y":401,"wires":[]},{"id":"3fe83871.c017c8","type":"function","z":"4dc47816.b23b88","name":"","func":"msg.payload = {\n store_id: \"RedAnt-01\", \n order_id: \"17450353\"\n};\nreturn msg;","outputs":1,"noerr":0,"x":232.5,"y":381,"wires":[["4a99916a.b5667"]]}] |