This file contains hidden or 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
| #!/bin/bash | |
| # Frees the pseudo-terminals Pane leaks on macOS (greenfield-inc/Pane#1083) without restarting Pane. | |
| # A leaked handle is a /dev/ptmx master held by Pane whose terminal end (/dev/ttysN) no process has open | |
| # and no process uses as its terminal. It must look leaked in two scans 5 s apart, and inside Pane each | |
| # handle is checked again (same device, same terminal number) right before it is closed. | |
| # Usage: free-pane-ptys.sh [--dry-run] [--min <n>] (acts only when at least <n> are leaked; default 50) | |
| set -u | |
| DRY=0; MIN=50; PORT=9229 | |
| while [ $# -gt 0 ]; do case "$1" in --dry-run) DRY=1;; --min) MIN="$2"; shift;; *) echo "unknown option $1"; exit 2;; esac; shift; done | |
| PANE_BIN=/Applications/Pane.app/Contents/MacOS/Pane |
This file contains hidden or 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 translate_shortcode( $atts = [], $content = null, $tag = '' ) { | |
| // Get current URI and set cache timeout | |
| $current_url = $_SERVER["REQUEST_URI"]; | |
| $cache_timeout = 86400; | |
| // normalize attribute keys, lowercase | |
| $atts = array_change_key_case( (array) $atts, CASE_LOWER ); | |
| // override default attributes with user attributes | |
| $custom_atts = shortcode_atts( |
This file contains hidden or 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
| choco install sqlite | |
| sqlite3 grafana.db 'PRAGMA journal_mode=wal;' | |
| az login | |
| az storage copy -s .\grafana.db -d https://<storage_account>.file.core.windows.net/<file_share> --subscription <subscription_name> |
This file contains hidden or 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 { BasePageComponent } from '../base-page/base-page.component'; | |
| @Component({ | |
| selector: 'app-first-page', | |
| templateUrl: './first-page.component.html', | |
| styleUrls: ['./first-page.component.scss'] | |
| }) | |
| export class FirstPageComponent extends BasePageComponent implements OnInit { | |
| private _clickCnt = 0; |
This file contains hidden or 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 { GoogleAnalyticsService } from '../google-analytics.service'; | |
| @Component({ | |
| template: '', | |
| }) | |
| export class BasePageComponent implements OnInit { | |
| constructor(protected $gaService: GoogleAnalyticsService) { } |
This file contains hidden or 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 { GoogleAnalyticsService } from '../google-analytics.service'; | |
| @Component({ | |
| selector: 'app-first-page', | |
| templateUrl: './first-page.component.html', | |
| styleUrls: ['./first-page.component.scss'] | |
| }) | |
| export class FirstPageComponent implements OnInit { | |
| private _clickCnt = 0; |
This file contains hidden or 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
| logEvent(event, category, label, value) { | |
| gtag('event', event, { | |
| event_category: category, | |
| event_label: label, | |
| value: value | |
| }); | |
| console.log('gtag event captured...'); | |
| } |
This file contains hidden or 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 { GoogleAnalyticsService } from './google-analytics.service'; | |
| @Component({ | |
| selector: 'app-root', | |
| templateUrl: './app.component.html', | |
| styleUrls: ['./app.component.scss'] | |
| }) | |
| export class AppComponent implements OnInit { | |
| title = 'Google Analytics Service'; |
This file contains hidden or 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 { BrowserModule } from '@angular/platform-browser'; | |
| import { NgModule } from '@angular/core'; | |
| import { AppRoutingModule } from './app-routing.module'; | |
| import { AppComponent } from './app.component'; | |
| import { GoogleAnalyticsService } from './google-analytics.service'; | |
| @NgModule({ | |
| declarations: [ |
NewerOlder