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; |
Forked from 14islands's Pen Basic Web Animations Tween.
A Pen by Captain Anonymous on CodePen.
#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:
| #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]))]; |