Skip to content

Instantly share code, notes, and snippets.

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 */
}
@sliceofbytes
sliceofbytes / weird-right-join.sql
Created May 21, 2018 18:59
SQL Syntax I haven't seen before
SELECT *
FROM BaseTable b
RIGHT JOIN (
SomeTable s
INNER JOIN OtherTable o ON o.ID = s.ID
INNER JOIN MoreTable m ON m.ID = f.ID
) ON b.ID = s.ID
import './polyfills.ts';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { enableProdMode } from '@angular/core';
import { environment } from './environments/environment';
import { AppModule } from './app/';
if (environment.production) {
enableProdMode();
}