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
<!-- | |
- Add a 'Text' widget with the content below (set 'mode' to 'html'). | |
- Make sure to enable JS parsing for this widget by setting the 'disable_sanitize_html' property to 'true' in your grafana.ini. | |
- For more detailed info, check out fi. https://www.worldometers.info/coronavirus/ | |
- STAY SAFE FOLKS! | |
--> | |
<center> | |
<div style="font-size: 20px">🦠<span id="confirmed"/></div> | |
<div style="font-size: 16px">💀<span id="deaths" /><span id="deathrate" style="color: #555; padding-left: 8px"/></div> |
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:[email protected] 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
export class ComponentWithRadListView { | |
// assuming you have something like this in your view: | |
// <RadListView (loaded)="onOrderListLoaded($event)"> | |
onOrderListLoaded(args): void { | |
const listViewElement = <RadListView>args.object; | |
const tk: any = listViewElement.ios; | |
if (tk && tk.pullToRefreshView) { | |
tk.pullToRefreshView.activityIndicator.color = new Color("#4CC55B").ios; |
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 { 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
// 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
// Usage: <Label maxLines="3" .. /> | |
import { Directive, ElementRef, Input, OnInit, OnChanges } from '@angular/core'; | |
import { Label } from 'tns-core-modules/ui/label'; | |
declare const android, NSLineBreakMode: any; | |
@Directive({ | |
selector: 'Label[maxLines]', | |
}) |
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 { Directive, ElementRef, Input, OnInit, OnChanges } from '@angular/core'; | |
import { Label } from 'ui/label'; | |
@Directive({ | |
selector: '[maxLines]', | |
}) | |
export class LabelMaxLinesDirective implements OnInit, OnChanges { | |
@Input('maxLines') public maxLines: number = 1; | |
public get nativeView(): Label { |
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
// angular | |
import {Component} from '@angular/core'; | |
@Component({ | |
moduleId: module.id, | |
selector: 'app', | |
template: ` | |
<StackLayout> | |
<page-router-outlet></page-router-outlet> | |
</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
// In case you embed a webview in a native app and the native app has a navigation bar you may find | |
// swiping up from the webview to the header (and releasing your finger on the header) will not fire | |
// a 'touchend' event on the webview. | |
// | |
// This code fixes it in a way where we listen for 'touchmove' events and fire a 'touchend' event | |
// programmatically in case the user leaves the webview at the top (negative Y coordinate): | |
document.addEventListener("touchmove", function(e) { | |
if (e.changedTouches[0].pageY < 0) { | |
e.preventDefault(); |
NewerOlder