Skip to content

Instantly share code, notes, and snippets.

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 March 12, 2020 15:52
Advise from an Expert on Covid-19

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.:

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 April 26, 2019 21:17 — forked from x35a/scaleFontSize.js
jq plugin decrease font size on text ovrfl
/*
works with JQ
usage
<p class="targetElement">Text to scale</p>
$('.targetElement').scaleFontSize({minFontsize: 12});
minFontsize минимальное размер шрифта для уменьшения, default 16px.
Определяется переполнение по ширине и высоте.
Определение переполнения по высоте работает если элементу задан height.
@sliceofbytes
sliceofbytes / gistlog.yml
Created April 22, 2019 14:28 — forked from askilondz/gistlog.yml
Adaptive Streaming with MPEG-DASH and HLS using AWS

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 April 18, 2019 21:15
Disable Reactive Forms Directive
// 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 ) {
@sliceofbytes
sliceofbytes / startup.cs
Created April 4, 2019 02:37
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 November 8, 2018 19:30
Keyboard Shortcut CSS Style
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 August 30, 2018 19:04
Cool way to populate array.
[...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]
@sliceofbytes
sliceofbytes / style-desaturate.css
Created July 18, 2018 14:08 — forked from internoma/style-desaturate.css
Desaturate & saturate css3
.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 */
}