Skip to content

Instantly share code, notes, and snippets.

Avatar

Eric sliceofbytes

View GitHub Profile
View wisconsin.ts
import cheerio from "cheerio";
import UserAgent from "user-agents";
import * as cloudscraper from "cloudscraper";
import { DataSource } from "../../DataSource";
import { SourceType } from "../../../definitions/sources/SourceType";
import { SourceData, SourceLocalityDataPoint } from "../../../definitions/sources/SourceData";
import { SourceFeatures } from "../../../definitions/sources/SourceFeatures";
import { NumericalUtilities } from "../../../utilities/NumericalUtilities";
@sliceofbytes
sliceofbytes / advise.md
Created Mar 12, 2020
Advise from an Expert on Covid-19
View advise.md

The author is James Robb a virologist at UC San Diego

Subject: What I am doing for the upcoming COVID-19 (coronavirus) pandemic

Dear Colleagues, as some of you may recall, when I was a professor of pathology at the University of California San Diego, I was one of the first molecular virologists in the world to work on coronaviruses (the 1970s). I was the first to demonstrate the number of genes the virus contained. Since then, I have kept up with the coronavirus field and its multiple clinical transfers into the human population (e.g., SARS, MERS), from different animal sources.

The current projections for its expansion in the US are only probable, due to continued insufficient worldwide data, but it is most likely to be widespread in the US by mid to late March and April.

Here is what I have done and the precautions that I take and will take. These are the same precautions I currently use during our influenza seasons, except for the mask and gloves.:

View test.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sliceofbytes
sliceofbytes / scaleFontSize.js
Created Apr 26, 2019 — forked from x35a/scaleFontSize.js
jq plugin decrease font size on text ovrfl
View scaleFontSize.js
/*
works with JQ
usage
<p class="targetElement">Text to scale</p>
$('.targetElement').scaleFontSize({minFontsize: 12});
minFontsize минимальное размер шрифта для уменьшения, default 16px.
Определяется переполнение по ширине и высоте.
Определение переполнения по высоте работает если элементу задан height.
@sliceofbytes
sliceofbytes / gistlog.yml
Created Apr 22, 2019 — forked from askilondz/gistlog.yml
Adaptive Streaming with MPEG-DASH and HLS using AWS
View gistlog.yml

Adaptive Streaming has become the neccessity for streaming video and audio. Unfortantely, as of this post, there isn't a whole lot of tutorials that accumulate all of the steps to get this working. Hopefully this post achieves that. This post focuses on using Amazon Web Services (AWS) to transcode for HLS and DASH and be the Content Delivery Network (CDN) that delivers the stream to your web page. We'll be using Video.js for the HTML5 player as well as javascript support libaries to make Video.js work with HLS and DASH.

So Here's what you need:

Set up three S3 buckets

@sliceofbytes
sliceofbytes / disableControl.directive.ts
Last active Apr 18, 2019
Disable Reactive Forms Directive
View disableControl.directive.ts
// https://netbasal.com/disabling-form-controls-when-working-with-reactive-forms-in-angular-549dd7b42110
import { NgControl } from '@angular/forms';
@Directive({
selector: '[disableControl]'
})
export class DisableControlDirective {
@Input() set disableControl( condition : boolean ) {
View startup.cs
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseExceptionHandler("/Home/Error");
app.UseHsts();
@sliceofbytes
sliceofbytes / style.css
Created Nov 8, 2018
Keyboard Shortcut CSS Style
View style.css
body {
font-size:18px;
}
.kbd{
padding: 0.1em 0.6em;
border: 1px solid #CCC;
font-family: Arial,Helvetica,sans-serif;
background-color: #F7F7F7;
color: #333;
-moz-box-shadow: 0 1px 0px rgba(0, 0, 0, 0.2),0 0 0 2px #ffffff inset;
@sliceofbytes
sliceofbytes / coolarray.js
Created Aug 30, 2018
Cool way to populate array.
View coolarray.js
[...Array(31).keys()] === [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]
View style-desaturate.css
.desaturate {
filter: grayscale(100%); /* Current draft standard */
-webkit-filter: grayscale(100%); /* New WebKit */
-moz-filter: grayscale(100%);
-ms-filter: grayscale(100%);
-o-filter: grayscale(100%); /* Not yet supported in Gecko, Opera or IE */
filter: url(resources.svg#desaturate); /* Gecko */
filter: gray; /* IE */
-webkit-filter: grayscale(1); /* Old WebKit */
}
You can’t perform that action at this time.