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
//make videojs responsive | |
$(function() { | |
$('.video-js').each(function() { | |
// Once the video is ready | |
var videoElm = $(this); | |
_V_($(this).attr('id')).ready(function() { | |
var myPlayer = this; // Store the video object | |
var aspectRatio = 9 / 16; // Make up an aspect ratio | |
function resizeVideoJS() { |
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
.content:after{ | |
content: " "; | |
display: block; | |
height: 0; | |
clear: both; | |
*zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML += '<div class="ie7-clear"></div>' ); | |
} | |
.ie7-clear { | |
display: block; | |
clear: both; |
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
///facilitates inheritance ....gist from https://gist.github.com/1542120 | |
;(function(Backbone) { | |
// The super method takes two parameters: a method name | |
// and an array of arguments to pass to the overridden method. | |
// This is to optimize for the common case of passing 'arguments'. | |
function _super(methodName, args) { | |
// Keep track of how far up the prototype chain we have traversed, | |
// in order to handle nested calls to _super. |
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 isElementInViewport (el) { | |
var rect = el.getBoundingClientRect(); | |
return ( | |
rect.top >= 0 && | |
rect.left >= 0 && | |
rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && /*or $(window).height() */ | |
rect.right <= (window.innerWidth || document.documentElement.clientWidth) /*or $(window).width() */ | |
); |
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
//https://ask.wireshark.org/questions/33938/how-can-i-filter-by-website-names | |
http.host=="exact.name.here" | |
http.host contains "partial.name.here" | |
Both of those filters are case-sensitive. | |
http.host matches "(?i)web\.site\.name" | |
http.host matches "(?i) web[.]site[.]name" | |
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 binomial(n, k) { | |
if ((typeof n !== 'number') || (typeof k !== 'number')) | |
return false | |
let coeff = 1 | |
for (var x = n-k+1; x <= n; x++) coeff *= x | |
for (x = 1; x <= k; x++) coeff /= x | |
return coeff | |
} |
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 compoundedInterest(value, pct, times) { | |
return value*(Math.pow(1 + pct/1, times) - 1); | |
} |
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 {DragDropModule} from '@angular/cdk/drag-drop'; | |
import {ScrollingModule} from '@angular/cdk/scrolling'; | |
import {CdkTableModule} from '@angular/cdk/table'; | |
import {CdkTreeModule} from '@angular/cdk/tree'; | |
import {NgModule} from '@angular/core'; | |
import { | |
MatAutocompleteModule, | |
MatBadgeModule, | |
MatBottomSheetModule, | |
MatButtonModule, |
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, EventEmitter, HostListener, Output} from '@angular/core'; | |
@Directive({ | |
// tslint:disable-next-line:directive-selector | |
selector: '[clickOutside]' | |
}) | |
export class ClickOutsideDirective { | |
private readonly startTime: number; | |
constructor(private elementRef: ElementRef) { |
OlderNewer