Skip to content

Instantly share code, notes, and snippets.

View simonkberg's full-sized avatar
:shipit:

Simon Kjellberg simonkberg

:shipit:
View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite tests="70" failures="0" errors="0" skipped="0" time="8.822" name="com.spotify.royaltyplatform.webapi.it.goldentests.BookingGoldenTest">
<properties>
<property name="spotify.components" value="rp-web-api"></property>
</properties>
<testcase classname="com.spotify.royaltyplatform.webapi.it.goldentests.BookingGoldenTest" name="Ingesting reruns as a user with no role returns a &#34;Client Error&#34; response (401 Unauthorized)" time="0.109"></testcase>
<testcase classname="com.spotify.royaltyplatform.webapi.it.goldentests.BookingGoldenTest" name="Ingesting reruns as a user with role &#34;viewer&#34; returns a &#34;Client Error&#34; response (401 Unauthorized)" time="0.187"></testcase>
<testcase classname="com.spotify.royaltyplatform.webapi.it.goldentests.BookingGoldenTest" name="Ingesting reruns as a user with role &#34;config editor&#34; returns a &#34;Client Error&#34; response (401 Unauthorized)" time="0.16"></testcase>
{"maintenance":true}
const srand32 = seed => {
const s = Math.sin(seed) * 10000;
return Math.floor((s - Math.floor(s)) * Math.pow(2, 32));
};
const suuid = seed =>
new Uint32Array(8)
.map((_, idx) => srand32(seed + idx))
.reduce((acc, val, idx) => acc + (idx < 2 || idx > 5 ? '' : '-') + val.toString(16).slice(-4), '');
const uuid = () => {
const arr = new Uint32Array(8);
window.crypto.getRandomValues(arr);
return arr.reduce((acc, val, idx) => acc + (idx < 2 || idx > 5 ? '' : '-') + val.toString(16).slice(-4), '');
};
(function(win, doc, version, onError, onUnhandledRejection, sentry) {
var SENTRY_SDK = win.SENTRY_SDK;
var queue = function(exception) {
queue.data.push(exception);
};
queue.data = [];
win[sentry] = function() {
var SDK = win.Sentry;
@simonkberg
simonkberg / grid.html
Created July 30, 2012 15:49
CSS-grid Generator
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>CSS-grid Generator</title>
<meta name="description" content="The easiest way to construct a basic CSS-grid layout. With query-strings!" />
<meta name="author" content="SimonKberg" />
<meta name="viewport" content="width=device-width; initial-scale=1.0" />
// @flow strict
class Node<K> {
key: K
next: Node<K> | null
prev: Node<K> | null
constructor(key: K) {
this.key = key
}
@simonkberg
simonkberg / reactiflux-qa.md
Last active April 4, 2018 20:25
Q&A with Sophie Alpert (@sophiebits) on Reactiflux 2016-06-09

Q: Are there plans to support a web worker based rendered in React Core ? Angular2 has support for it in core - axemclion
A: right now we're not considering web workers in depth because it's difficult to carve off pieces that can be parallelized independently -- simply moving React to a separate thread while executing DOM operations on the main thread would free up the main thread but likely wouldn't improve responsiveness overall. so instead we're looking more at how we can do concurrent work on the main thread and cancel in-progress updates if new high-priority input arrives
we might experiment a little more with threads/workers on React Native, but that would likely be more along the lines of running parts of Relay in a separate thread since it's still hard to split up the component tree

Q: did you ever think you’d be learning about fibers and coroutines to implement a JavaScript UI library? 😃 - iamdustan
A: can't say I ever considered it, but I suppose I didn't expect that I wou

import React, { Component } from 'react'
import classNames from 'classnames'
import styles from './Styles.css'
// Constant with scroll offset to trigger sticky
const SCROLL_OFFSET = 100
class ComponentThatNeedsScrollHandling extends Component {
state = { sticky: false }
ticking = false
fallocate -l 1G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
sysctl vm.swappiness=10
sysctl vm.vfs_cache_pressure=50
echo 'vm.swappiness = 10' | sudo tee -a /etc/sysctl.conf
echo 'vm.vfs_cache_pressure = 50' | sudo tee -a /etc/sysctl.conf