Skip to content

Instantly share code, notes, and snippets.

View jbristowe's full-sized avatar
👨‍💻
"It's complicated."

John Bristowe jbristowe

👨‍💻
"It's complicated."
View GitHub Profile
{
"version": "npm run release",
"preversion": "npm test",
"postversion": "git push && git push --tags",
"clean": "npm-run-all -p clean:*",
"clean:build": "rimraf build",
"clean:dist": "rimraf dist",
"clean:release": "rimraf release",
"build": "webpack --display-error-details",
"build:release": "cross-env NODE_ENV=production npm run build",

Keybase proof

I hereby claim:

  • I am jbristowe on github.
  • I am jbristowe (https://keybase.io/jbristowe) on keybase.
  • I have a public key whose fingerprint is A984 A74D 2CF8 06C9 6D30 1FB4 BEA2 A05C 081D F043

To claim this, I am signing this object:

How To: Wrap Text in a Button with NativeScript

It's pretty simple. Let's assume the following element in your markup:

<Button text="Hello! Is it me you're looking for?" id="wrapButton" />

By default, Android and iOS truncate the text. You can override this behaviour with the following code:

NativeScript LiveSync with Console Output with iOS Simulator

NativeScript LiveSync does not currently emit console output (via console.log()) via the CLI:

$ tns livesync ios --emulator —watch

There's a couple of ways to make this work. In both cases, you'll need the hash for the iOS simulator/device you're targeting:

$ instruments -s devices

A Very Rough Guide to Firebase and NativeScript

Create Plugin

  • mkdir nativescript-firebase
  • cd nativescript-firebase
  • npm init
  • tns init
  • mkdir -p platforms/ios
  • touch platforms/ios/Podfile
var context = new LAContext();
try {
if (context.canEvaluatePolicyError(LAPolicy.LAPolicyDeviceOwnerAuthenticationWithBiometrics)) {
context.evaluatePolicyLocalizedReasonReply(LAPolicy.LAPolicyDeviceOwnerAuthenticationWithBiometrics,
"Are you the device owner?",
function (success, error) {
if (error) {
// error; problem verifying identity
return;
}
var listener = new Listener("NativeScript Rocks!!11!");
trace.addEventListener(listener);
[
{
"City": "Sofia",
"Country": "Bulgaria",
"Country_ISO3": "BGR",
"Pop1950": 520,
"Pop1955": 620,
"Pop1960": 710,
"Pop1965": 810,
"Pop1970": 890,

Notes: PhoneGap/Cordova, Visual Studio 2013 Update 2, and Windows Phone 8.1

Based on observations made with PhoneGap/Cordova 3.4, Visual Studio 2013 Update 2 (RTM), and Windows Phone 8.1.

  • Projects generated via the PhoneGap or the Cordova CLI can run (unmodified) in emulators for Windows Phone 8.0 and Windows Phone 8.1
  • Windows Phone 8.0 projects must be re-targeted to Windows Phone 8.1 for script debugging within the Windows Phone 8.1 emulator
  • Projects generated via the PhoneGap or the Cordova CLI that are re-targeted to Windows Phone 8.1 are converted to Windows Phone Silverlight 8.1 projects
    • Windows Phone Silverlight 8.1 projects do not support script debugging in Visual
using EQATEC.Analytics.Monitor;
using System.Diagnostics;
public class DebugLogger : ILogAnalyticsMonitor
{
public void LogMessage(string message)
{
Debug.WriteLine("MESSAGE: " + message);
}