// jQuery
$(document).ready(function() {
// code
})
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
- Avoid too many reflows (the browser to recalculate everything)
- Use advanced CSS3 for graphic card rendering
- Precalculate sizes and positions
The reflow appens as many times as there are frames per seconds. It recalculate all positions that change in order to diplay them. Basically, when you scroll you execute a function where you move things between two reflows. But there are functions that triggers reflows such as jQuery offset, scroll... So there are two things to take care about when you dynamically change objects in javascript to avoid too many reflows:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="import" href="../components/polymer/polymer.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { | |
position: absolute; | |
width: 100%; | |
height: 100%; |
The prep-script.sh
will setup the latest Node and install the latest perf version on your Linux box.
When you want to generate the flame graph, run the following (folder locations taken from install script):
sudo sysctl kernel/kptr_restrict=0
perf record -i -g -e cycles:u -- ~/sources/node/node --perf-basic-prof script.js
perf script | egrep -v "( __libc_start| LazyCompile | v8::internal::| Builtin:| Stub:| LoadIC:|\[unknown\]| LoadPolymorphicIC:)" | sed 's/ LazyCompile:[*~]\?/ /' | ~/sources/FlameGraph/stackcollapse-perf.pl > out.perf-folded
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env stap | |
global samples | |
global all_samples | |
global timestamp | |
probe process("node").mark("gc__start") | |
{ | |
timestamp = gettimeofday_us() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// flow-typed signature: 11e550b72570f3e50044485062a42c26 | |
// flow-typed version: 33aa7c82cd/isomorphic-fetch_v2.x.x/flow_>=v0.27.x | |
declare type $Fetch$RequestMode = 'cors' | 'no-cors' | 'cors-with-forced-preflight' | 'same-origin' | 'navigate'; | |
declare type $Fetch$RequestCredentials = 'omit' | 'same-origin' | 'include'; | |
declare type $Fetch$RequestRedirect = 'follow' | 'error' | 'manual'; | |
declare type $Fetch$RequestCache = 'default' | 'no-store' | 'reload' | 'no-cache' | 'force-cache'; | |
declare type $Fetch$ResponseType = 'basic' | 'cors' | 'error' | 'opaque'; | |
declare type $Fetch$ReferrerPolicy = 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | | |
'origin-when-cross-origin' | 'unsafe-url'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @flow | |
import type { A } from 'my-module'; | |
const myFunction = (foo: A): boolean => !!foo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {Component} from 'react'; | |
import {bindActionCreators} from "redux" | |
import { connect } from 'react-redux'; | |
import {schema, getModelByType} from "models/models" | |
import SomeFormComponent from "SomeFormComponent" | |
import {selectedItemSelector, isEditingSelector} from "selectors/entities" | |
let mapStateToProps = (state) => { |