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 processInbox() { | |
var threads = GmailApp.search("is:unread in:inbox has:nouserlabels from:notifications@github.com newer_than:1h"); | |
for (var i = 0; i < threads.length; i++) { | |
var messages = threads[i].getMessages(); | |
for (var j = 0; j < messages.length; j++) { | |
processMessage(messages[j]); | |
} | |
} |
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
// In case of Angular, this is the component that contains a view with a <RadSideDrawer> | |
export class MenuComponent implements AfterViewInit { | |
@ViewChild(RadSideDrawerComponent) public drawerComponent: RadSideDrawerComponent; | |
private _drawer: SideDrawerType; | |
ngAfterViewInit(): void { | |
this._drawer = this.drawerComponent.sideDrawer; | |
this._changeDetectionRef.detectChanges(); |
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 { Color } from "tns-core-modules/color"; | |
declare const UIControlStateSelected: any; | |
export class CheckoutComponent implements OnInit { | |
// this assumes you have this in your html: <SegmentedBar #paymentOptionsBar ..> | |
@ViewChild("paymentOptionsBar") paymentOptionsBar: ElementRef; | |
ngOnInit(): void { |
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
"use strict"; | |
(function() { | |
var intervalID = null; | |
function startCheckingNetworkConnection() { | |
intervalID = setInterval(function() { | |
var networkState = navigator.connection.type; | |
var isWifi = networkState == Connection.WIFI; |
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 { ad } from "tns-core-modules/utils/utils"; | |
import { isIOS } from "tns-core-modules/platform"; | |
let is24HourFormat: boolean; | |
if (isIOS) { | |
// solution from https://stackoverflow.com/a/12236693/2596974 | |
const dateFormat: string = NSDateFormatter.dateFormatFromTemplateOptionsLocale("j", 0, NSLocale.currentLocale); | |
is24HourFormat = dateFormat.indexOf("a") === -1; | |
} else { | |
// https://developer.android.com/reference/android/text/format/DateFormat.html#is24HourFormat(android.content.Context) |
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 { Component, OnInit } from "@angular/core"; | |
import { DeviceType } from "ui/enums"; | |
import { device } from "platform"; | |
import { Page } from "ui/page"; | |
@Component({ | |
moduleId: module.id, | |
selector: "my-component", | |
templateUrl: "my-component.html", | |
styleUrls: ["my-component.css"] |
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
/* my-component.css */ | |
Label.text { | |
font-size: 15; | |
} | |
/* my-component.tablet.css */ | |
.tablet Label.text { | |
font-size: 19; | |
} |
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
<!-- 'master' view --> | |
<ActionBar></ActionBar> | |
<GridLayout [columns]="isTablet ? '*, *' : '*'"> | |
<StackLayout> | |
<!-- 'master' ListView --> | |
</StackLayout> | |
<StackLayout col="1" *ngIf="isTablet"> | |
<!-- 'detail-contents' component, only for tablets --> | |
<detail-contents></detail-contents> | |
</StackLayout> |
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
// required imports: | |
import { DeviceType } from "ui/enums"; | |
import { device } from "platform"; | |
// then wherever you need it: | |
const isTablet: boolean = device.deviceType === DeviceType.Tablet; |
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
<!-- Speech recognition usage consent --> | |
<key>NSSpeechRecognitionUsageDescription</key> | |
<string>My custom recognition usage description. Overriding the default empty one in the plugin.</string> | |
<!-- Microphone usage constent --> | |
<key>NSMicrophoneUsageDescription</key> | |
<string>My custom microphone usage description. Overriding the default empty one in the plugin.</string> |