#Generate cities data
wget http://download.geonames.org/export/dump/cities15000.zip
unzip cities15000.zip
node geonames.js cities15000.txt
The result is json array of cities in the following format:
{
_id:
#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]))]; |
#Generate cities data
wget http://download.geonames.org/export/dump/cities15000.zip
unzip cities15000.zip
node geonames.js cities15000.txt
The 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.
var shhh = "SECRETPASSWORD"; | |
function hexToRgb(hex) { | |
// No RegEx in Espruino yet... | |
var R, G, B; | |
if (hex.length == 3) { | |
R = hex.substring(0, 1); | |
R = R + R; | |
G = hex.substring(1, 2); | |
G = G + G; |