Skip to content

Instantly share code, notes, and snippets.

componentDidUpdate(prevProps: any) {
console.log();
console.log();
console.log("componentDidUpdate");
Object.entries(this.props).forEach(([key, value]) => {
console.log(
key,
value,
@Pajn
Pajn / WSL.md
Last active October 19, 2018 14:24
Set up WSL
<html>
<body>
<div style="font-size: 1rem">
<p>
1 rem
</p>
<p>
The fox jumps over the lazy dog
</p>

Keybase proof

I hereby claim:

  • I am pajn on github.
  • I am pajn (https://keybase.io/pajn) on keybase.
  • I have a public key whose fingerprint is CF8D 7890 21E7 BD16 EF31 39ED CD8C 4F15 F2A8 B387

To claim this, I am signing this object:

I'm working on a compile to JS language and when tinkering with the emitter I found some strange performance difference A tuple type in the language is emitted as an JS array and a tuple type constructor is emitted as a function that returns it arguments as an JS array.

I tried these three outputs and discovered unexpectedly big performance differences. The only differences is how the tuple constructors are emitted, and the time is how long it taks for the compiler to build itself.

  • (...members) => members: ~3.6 seconds
  • function () {return Array.prototype.slice.call(arguments)} ~4.6 seconds

För eduroam i Linux:

Jag använde även Googles DNS servrar, vet inte om det faktiskt behövs eller inte men

-----BEGIN CERTIFICATE-----
MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEU
MBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFs
IFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290
MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFowbzELMAkGA1UEBhMCU0Ux
FDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRUcnVzdCBFeHRlcm5h
bCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0EgUm9v
dDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvt
H7xsD821+iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9
uMq/NzgtHj6RQa1wVsfwTz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzX
/*
* Copyright 2013 Palantir Technologies, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@Pajn
Pajn / counter.js
Created February 22, 2016 10:32
Adding a reset to Cycle counter example
const Cycle = require('@cycle/core');
const {makeDOMDriver, div, button, p} = require('@cycle/dom');
const {Observable} = require('rx');
function main(sources) {
const decrement$ = sources.DOM
.select('.decrement').events('click').map(ev => -1);
const increment$ = sources.DOM
@Pajn
Pajn / mock.js
Last active December 5, 2015 15:49
'use strict';
/**
* Wraps the passed function to track its calls.
*
* All calls are stored in an array on a calls property.
* Every call is an object with a context and args property.
*/
function trackCalls(fn) {
const calls = [];