Charts are from different sources and thus colors are inconsistent, please carefully read the chart's legends.
Like this? Check React Native vs Flutter: https://gist.github.com/tkrotoff/93f5278a4e8df7e5f6928eff98684979
// INCOMPLETE | |
// This command will give you list of available FFMPEG formats and their default Mime types | |
// ffmpeg -formats -hide_banner | tail -n +5 | cut -c5- | cut -d' ' -f1 | xargs -i{} ffmpeg -hide_banner -h demuxer={} | pcregrep -o2 -o4 -M '(Muxer (\w+) )|(Mime type:( .*).)' | |
// And then parse the output with regex to JSON format in JavaScript for example: | |
// str.match(/(.*)\n (.*)/gm).map(m => `"${m.replace(/\n /, '": "')}"`).join(',\n'); | |
// Combine the output with MDN - Common MIME types | |
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types | |
// And with IANA: |
Charts are from different sources and thus colors are inconsistent, please carefully read the chart's legends.
Like this? Check React Native vs Flutter: https://gist.github.com/tkrotoff/93f5278a4e8df7e5f6928eff98684979
import { Component } from '@angular/core'; | |
import { TestBed } from '@angular/core/testing'; | |
import { By } from '@angular/platform-browser'; | |
import { AliasDirective } from './alias.directive'; | |
describe('Alias directive', () => { | |
beforeEach(() => | |
TestBed.configureTestingModule({ | |
declarations: [AliasDirective, DoubleComponent, TripleComponent], | |
})); |
/* | |
To setup, place in scripts/generate.js and add | |
"st:generate": "node scripts/generate.js" | |
To your npm scripts. | |
To generate a component in src/components/ run | |
npm run st:generate component my-component |
This script spins up a number of agents (default 4), each with a certain average timeBetweenActions (default 400msec), and it uses a Poisson process in order to keep that average timeBetweenActions, but randomly distributed within that constraint. Think - popcorn popping!
This statistical trick is a valid model of random arrivals of users at a website, and will distribute load nicely. Thanks to the live-updating progress indicators of ascii-progress, and the awesome stream-fu provided by RxJS!
Here's a short video of my thoughts on the matter: https://www.youtube.com/watch?v=0GnB8FAJjfY
var str = 'class ಠ_ಠ extends Array {constructor(j = "a", ...c) {const q = (({u: e}) => {return { [`s${c}`]: Symbol(j) };})({});super(j, q, ...c);}}' + | |
'new Promise((f) => {const a = function* (){return "\u{20BB7}".match(/./u)[0].length === 2 || true;};for (let vre of a()) {' + | |
'const [uw, as, he, re] = [new Set(), new WeakSet(), new Map(), new WeakMap()];break;}f(new Proxy({}, {get: (han, h) => h in han ? han[h] ' + | |
': "42".repeat(0o10)}));}).then(bi => new ಠ_ಠ(bi.rd));'; | |
try { | |
eval(str); | |
} catch(e) { | |
alert('Your browser does not support ES6!') | |
} |
I wanted to easily make HTTP requests (both GET & POST) with a simple interface that returns promises.
The popular request
& request-promises
package are good, but I wanted to figure out how to do it w/out using external dependencies.
The key features are:
A little while ago I started using Typescript with the Angular 1.5 app I'm working on, to help ease the migration path to Angular 2. Here's how I did it. We'll go example by example through migrating real world code living in a large, mostly non-Typescript codebase.
Let's start with a few of the basic angular building blocks, then we'll go through some of the higher level patterns we derived.
// paste in your console | |
speechSynthesis.onvoiceschanged = function() { | |
var msg = new SpeechSynthesisUtterance(); | |
msg.voice = this.getVoices().filter(v => v.name == 'Cellos')[0]; | |
msg.text = Object.keys(window).join(' '); | |
this.speak(msg); | |
}; |