Skip to content

Instantly share code, notes, and snippets.

View andre487's full-sized avatar
🎠
My horse is amazing

Andrey Prokopyuk andre487

🎠
My horse is amazing
View GitHub Profile
@hcodes
hcodes / metrika-errors.js
Last active May 30, 2019 12:48
ΠžΡ‚ΡΠ»Π΅ΠΆΠΈΠ²Π°Π½ΠΈΠ΅ js-ошибок с ΠΏΠΎΠΌΠΎΡ‰ΡŒΡŽ ΠœΠ΅Ρ‚Ρ€ΠΈΠΊΠΈ
window.onerror = function(msg, file, line, col, err) {
if (!window.JSON) {
return;
}
var counterId = 12345,
siteInfo = {},
pointer = siteInfo;
path = [
'JS errors',
@acdha
acdha / ga-time-to-first-paint.js
Created August 19, 2015 18:33
Record time to first paint on Chrome/IE using Google Analytics user timing
(function ($) {
'use strict';
/* Based on https://github.com/wikimedia/mediawiki-extensions-NavigationTiming/ */
function recordTimeToFirstPaint() {
// Use Chrome's loadTimes or IE 9+'s msFirstPaint to record the time to render in milliseconds:
var firstPaintTime, timingSource;
if ('chrome' in window && $.isFunction(window.chrome.loadTimes)) {
/**
* Returns the global object.
* Works even inside ES6 modules.
*/
function getGlobalObject() {
// Workers don’t have `window`, only `self`
if (typeof self !== 'undefined') {
return self;
}
if (typeof global !== 'undefined') {
@trevnorris
trevnorris / all-my-knowledge.md
Last active December 9, 2017 00:39
Here's a rundown of everything I use to do performance analysis in Node.

Introduction

Here is a collection of tips and tricks I've picked up about doing performance analysis on Node. Included is a build script that should get a base install of Ubuntu fully functional and ready for all the things we'll be going through.

The script pulls a lot of code from the latest master of each repository. So it's possible that something may fail, but to date I haven't had any issues.

First, go ahead and run the script. Then go take a nice long break. It'll

@totherik
totherik / gist:3a4432f26eea1224ceeb
Last active March 15, 2025 06:06
v8 --allow-natives-syntax RuntimeFunctions
Per https://code.google.com/p/v8/codesearch#v8/trunk/src/runtime.cc
%CreateSymbol
%CreatePrivateSymbol
%CreateGlobalPrivateSymbol
%NewSymbolWrapper
%SymbolDescription
%SymbolRegistry
%SymbolIsPrivate
@trevnorris
trevnorris / perf-flame-graph-notes.md
Last active December 24, 2023 05:25
Quick steps of how to create a flame graph using perf

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
# May also have to do the following:
# (additional reading http://unix.stackexchange.com/questions/14227/do-i-need-root-admin-permissions-to-run-userspace-perf-tool-perf-events-ar )
sudo sysctl kernel.perf_event_paranoid=0
@denji
denji / http-benchmark.md
Last active April 26, 2025 20:16
HTTP(S) Benchmark Tools / Toolkit for testing/debugging HTTP(S) and restAPI (RESTful)
@marcelom
marcelom / pysyslog.py
Created December 5, 2012 18:06
Tiny Python Syslog Server
#!/usr/bin/env python
## Tiny Syslog Server in Python.
##
## This is a tiny syslog server that is able to receive UDP based syslog
## entries on a specified port and save them to a file.
## That's it... it does nothing else...
## There are a few configuration parameters.
LOG_FILE = 'youlogfile.log'
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 29, 2025 13:59
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@jaydson
jaydson / gist:1780598
Created February 9, 2012 15:11
How to detect a click event on a cross domain iframe
var myConfObj = {
iframeMouseOver : false
}
window.addEventListener('blur',function(){
if(myConfObj.iframeMouseOver){
console.log('Wow! Iframe Click!');
}
});
document.getElementById('YOUR_CONTAINER_ID').addEventListener('mouseover',function(){