This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
var args = process.argv | |
var dictFile = args[2] || 'image_names.csv' | |
var filesDir = args[3] || '' | |
var fs = require('fs') | |
var dictStr = fs.readFileSync(dictFile, { | |
encoding: 'utf8' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <WindowsAzureMobileServices/WindowsAzureMobileServices.h> | |
MSClient *client = [MSClient clientWithApplicationURLString:@"https://lmd-kitesurfer-pusher.azure-mobile.net/" | |
withApplicationKey:@"JzGucSijyOsYJDehJGJIGFCzJiujhR38"]; | |
NSDictionary *input = @{ | |
@"alert": @"Hey looser! I've just beat your highscore! :-P", // Notification text | |
@"sound": @"default", // Always send "default" | |
@"filters": @{ | |
@"devices": @[@"88888888 88888888 ... . . . .", @"12345678 90abcdef ... . . . ."] // Device token list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var q = azureClient.getTable('clientDevices').select('_count').where({ isActive: true }) | |
if (filters.deviceModel && filters.deviceModel.length > 0) q.where(function(arr) { return this.deviceModel in arr }, filters.deviceModel) | |
if (filters.deviceOsVersion && filters.deviceOsVersion.length > 0) q.where(function(arr) { return this.deviceOsVersion in arr }, filters.deviceOsVersion) | |
if (filters.appVersion && filters.appVersion.length > 0) q.where(function(arr) { return this.appVersion in arr }, filters.appVersion) | |
if (filters.languageCode && filters.languageCode.length > 0) q.where(function(arr) { return this.languageCode in arr }, filters.languageCode) | |
if (filters.countryCode && filters.countryCode.length > 0) q.where(function(arr) { return this.countryCode in arr }, filters.countryCode) | |
q.where({ isDevMode: (filters.isDevMode) ? true : false }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function defer() { | |
var handlers = []; | |
var value; | |
var error; | |
return { | |
promise: { | |
then: function(callback, errback) { | |
var d = defer() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Module dependencies. | |
*/ | |
var express = require('express') | |
, routes = require('./routes') | |
, http = require('http') | |
, path = require('path'); |