Skip to content

Instantly share code, notes, and snippets.

Avatar

Vikram Vasudevan VikramVasudevan

View GitHub Profile
View getApachePerformanceStats.awk
BEGIN {
print "<OL>";
}
{
split($0,a,"--");
split(a[2],responseTimeArray,"/");
if(responseTimeArray[2] > 4000000)
print "<li>",$0, a[2],":",responseTimeArray[2],"</li>";
}
View getApachePerformanceStats.sh
#!/bin/sh
#Configuration Parameters
APACHE_LOG_DIR=<Your apache log dir with full path>
APACHE_LOG_FILE=<Your apache log file with full path>
SCRIPT_DIR=<Your scripts directory with full path>
SERVICES_LIST=<Space separated list of service URIs for which you want to assess performance>
FROM_EMAIL_ADDR=<From email address>
TO_EMAIL_ADDRESSES=<Comma separated list of to email addresses>
SERVICE_BASE_URI=<Your service base URI that can identify all your services>
View scroll-slideshow-item.component.css
.slide-show-item {
font-size : 13vw;
width: 99vw;
height: 95vh;
background-color : black;
color : red;
border : 2px solid white;
position : absolute;
top : 0;
left : 0;
View scroll-slideshow.component.css
.slide-show-container {
background-color : black;
color : white;
position : relative;
width : 100vw;
height : 95vw;
}
View scroll-slideshow-item.component.html
<div #slideshowitem
[@scrollTrigger]="{ value : show, params : { initEnterTranslate : enterInitPosition, exitTranslate : exitPosition }}"
class="slide-show-item" *ngIf="show">
<ng-content></ng-content>
</div>
View scroll-slideshow.component.html
<div class="slide-show-container" mouseWheel (mouseWheelUp)="onMouseWheelUpFunc()"
(mouseWheelDown)="onMouseWheelDownFunc()">
<scroll-slideshow-item *ngFor="let slide of slides ; let i = index">
{{i + 1 }}. {{slide}}
</scroll-slideshow-item>
</div>
View scroll-slideshow-item.component.ts
import { Component, OnInit, ViewChild, ElementRef } from '@angular/core';
import { trigger, transition, animate, style, state, animation, useAnimation } from '@angular/animations';
export const enterAnimation = animation([
style({ opacity: 0, transform: 'translateX({{ initEnterTranslate }})' }),
animate('1000ms ease-in', style({ opacity: 1, transform: 'translateX(0%)' }))
]
);
export const exitAnimation = animation([
View scroll-slideshow.component.ts
import { Component, OnInit, ContentChildren, QueryList, AfterContentInit, ViewChildren, AfterViewInit } from '@angular/core';
import { ScrollSlideshowItemComponent } from '../scroll-slideshow-item/scroll-slideshow-item.component';
@Component({
selector: 'scroll-slideshow',
templateUrl: './scroll-slideshow.component.html',
styleUrls: ['./scroll-slideshow.component.css']
})
export class ScrollSlideshowComponent implements OnInit, AfterViewInit {
slides = ["Here is slide1", "Here is slide 2", "Here is slide 3", "Questions?"];
View mouse-wheel.directive.ts
import { Directive, Output, HostListener, EventEmitter } from '@angular/core';
@Directive({ selector: '[mouseWheel]' })
export class MouseWheelDirective {
throttleTime: number = Date.now();
@Output() mouseWheelUp = new EventEmitter();
@Output() mouseWheelDown = new EventEmitter();
@HostListener('mousewheel', ['$event']) onMouseWheelChrome(event: any) {
this.throttle(this.mouseWheelFunc, 2000, event)();