Skip to content

Instantly share code, notes, and snippets.

Rasmus Eneman Pajn

Block or report user

Report or block Pajn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View react diff logg.tsx
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 Oct 19, 2018
Set up WSL
View font-size.html
<html>
<body>
<div style="font-size: 1rem">
<p>
1 rem
</p>
<p>
The fox jumps over the lazy dog
</p>
View kaybase.md

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:

View arguments.md

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
View eduroam.md

För eduroam i Linux:

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

View AddTrust_External_CA_Root.pem
-----BEGIN CERTIFICATE-----
MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEU
MBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFs
IFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290
MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFowbzELMAkGA1UEBhMCU0Ux
FDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRUcnVzdCBFeHRlcm5h
bCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0EgUm9v
dDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvt
H7xsD821+iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9
uMq/NzgtHj6RQa1wVsfwTz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzX
View blankLinesRule.js
/*
* 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 Feb 22, 2016
Adding a reset to Cycle counter example
View counter.js
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
View mock.js
'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 = [];
You can’t perform that action at this time.