Skip to content

Instantly share code, notes, and snippets.

<?xml version='1.0' encoding='utf-8'?>
<widget id="io.cordova.hellocordova" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>HelloCordova</name>
<description>
A sample Apache Cordova application that responds to the deviceready event.
</description>
<author email="dev@cordova.apache.org" href="http://cordova.io">
Apache Cordova Team
</author>
<content src="index.html" />
// The scope of 'this' is the event. In order to call the 'receivedEvent'
// function, we must explicity call 'app.receivedEvent(...);'
onDeviceReady: function() {
app.receivedEvent('deviceready');
function onSuccess(contacts) {
alert('Found ' + contacts.length + ' contacts.');
console.log(JSON.stringify(contacts));
@sgrebnov
sgrebnov / gist:e947712eb441b5084d49
Last active August 29, 2015 14:02
Visual Studio for MDA development - enable console output for Windows Phone 8

Currently Windows Phone 8 deploy command (deploy.js) is blocking + it uses ReadAll insteadof while loop and ReadLine. Due to this there is no way to see real time output from the app in Visual Studio output window.

Instructions below could be used to fix this.

  1. Find the following file (should be created after you build Windows Phone platform at least once) YouCordovaApp\bld\Debug\platforms\wp8\cordova\lib\deploy.js
  2. Fine function exec_verbose(command) command inside it
  // executes a commmand in the shell
  function exec_verbose(command) {
function copyMrtImage(src, dest){
var srcDir = path.dirname(src),
srcExt = path.extname(src),
srcFileName = path.basename(src, srcExt);
var destDir = path.dirname(dest),
destExt = path.extname(dest),
destFileName = path.basename(dest, destExt);
// all MRT images: logo.png, logo.scale-100.png, logo.scale-200.png, etc
@sgrebnov
sgrebnov / gist:3bfa8ac13defc78b9148
Created July 4, 2014 16:08
Sample config with Icons and Splashes for Windows
<?xml version='1.0' encoding='utf-8'?>
<widget id="io.cordova.hellocordova" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>HelloCordova</name>
<description>
A sample Apache Cordova application that responds to the deviceready event.
</description>
<author email="dev@cordova.apache.org" href="http://cordova.io">
Apache Cordova Team
</author>
<content src="index.html" />
@sgrebnov
sgrebnov / gist:98b2032956e9b9a3d038
Last active August 29, 2015 14:18
octoblu/alljoyn method calls sample
// https://github.com/sgrebnov/alljoyn
var alljoyn = require('alljoyn');
var sessionId = 0;
var portNumber = 25;
var advertisedName = 'org.alljoyn.Bus.sample';
var interfaceName = 'org.alljoyn.Bus.sample';
var interfacePath = '/sample';
@sgrebnov
sgrebnov / gist:25fb9f31c186dd512085
Created November 4, 2015 19:25
AllJoyn-Cordova on Windows log
'WWAHost.exe' (Win32): Loaded 'C:\Windows\SysWOW64\WWAHost.exe'. Cannot find or open the PDB file.
'WWAHost.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Cannot find or open the PDB file.
'WWAHost.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file.
'WWAHost.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Cannot find or open the PDB file.
'WWAHost.exe' (Win32): Loaded 'C:\Windows\SysWOW64\apphelp.dll'. Cannot find or open the PDB file.
'WWAHost.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel.appcore.dll'. Cannot find or open the PDB file.
'WWAHost.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcrt.dll'. Cannot find or open the PDB file.
'WWAHost.exe' (Win32): Loaded 'C:\Windows\SysWOW64\rpcrt4.dll'. Cannot find or open the PDB file.
'WWAHost.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sspicli.dll'. Cannot find or open the PDB file.
'WWAHost.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cryptbase.dll'. Cannot find or open the PDB file.
cordova-paramedic: creating temp project at /var/folders/57/_6xc17jj33l8n4k8x6f5q23r0000gn/T/tmp-2807bejGgRKG7JqP
cordova-paramedic: installing plugins
cordova-paramedic: installing cordova-plugin-battery-status
cordova-paramedic: installing cordova-plugin-camera
cordova-paramedic: installing cordova-plugin-console
cordova-paramedic: installing cordova-plugin-contacts
cordova-paramedic: installing cordova-plugin-device
cordova-paramedic: installing cordova-plugin-device-motion
cordova-paramedic: installing cordova-plugin-device-orientation
cordova-paramedic: installing cordova-plugin-dialogs
@sgrebnov
sgrebnov / cordova-plugin-ms-outlook
Last active June 11, 2016 17:52
O365/Outlook Cordova Plugin sample code
var resourceUrl = 'https://outlook.office365.com';
var officeEndpointUrl = 'https://outlook.office365.com/ews/odata';
var TENANT_NAME = '17bf7168-5251-44ed-a3cf-37a5997cc451';
var appId = '3cfa20df-bca4-4131-ab92-626fb800ebb5';
var redirectUrl = "http://test.com";
var authUrl = 'https://login.windows.net/' + TENANT_NAME + '/';
var TEST_USER_ID = '';
C:\pbi
λ git clone https://github.com/Microsoft/PowerBI-visuals
Cloning into 'PowerBI-visuals'...
remote: Counting objects: 17209, done.
remote: Total 17209 (delta 0), reused 0 (delta 0), pack-reused 17209R
Receiving objects: 100% (17209/17209), 125.64 MiB | 516.00 KiB/s, done.
Resolving deltas: 100% (12376/12376), done.
Checking connectivity... done.
Checking out files: 100% (883/883), done.