Skip to content

Instantly share code, notes, and snippets.

View nikitaeverywhere's full-sized avatar
🇺🇦
Just build it!

Nikita Savchenko nikitaeverywhere

🇺🇦
Just build it!
View GitHub Profile
/**
* Just a piece of code to start.
*/
const host = "127.0.0.1:57772";
let ws = new WebSocket(`ws://${ host }/csp/user/WebCourse.ChatWebSocket.cls`);
ws.addEventListener(`open`, () => {
console.log(`We are connected to the chat!`);
});
@nikitaeverywhere
nikitaeverywhere / cloneNodeDeepWithStyles.js
Created May 13, 2017 14:27
Deep node clone node with styles cloning
function deepCloneWithStyles (node) {
const style = window.getComputedStyle(document.body, null);
const clone = node.cloneNode(false);
if (clone.style && style.cssText)
clone.style.cssText = style.cssText;
for (let child of node.childNodes)
clone.appendChild(deepClone(child));
return clone;
}
@nikitaeverywhere
nikitaeverywhere / TEST.sol
Last active May 4, 2018 17:29
Can't be verified at Etherscan https://ropsten.etherscan.io/address/0x746612a6d4dcadbff55619bedeba403c0c252361#code (optimization with runs = 200 were used, both in Truffle 0.4.23 and remix with compiler version 0.4.23+commit.124ca40d.Emscripten.clang). [SOLVED] https://ethereum.stackexchange.com/a/47572/22038
pragma solidity 0.4.23;
contract TEST {
string public someVal;
string public someVal2;
bytes32 public signature1 = keccak256(
"address TEST TEST TEST TEST",
"address TEST TEST TEST TEST TEST TEST",
=1173002295&_v=j83&z=1887421163
2020-06-21T20:41:02.409Z proxied: stats.g.doubleclick.net/r/collect?v=1&aip=1&t=dc&_r=3&tid=UA-55446531-20&cid=9257118.1592772062&jid=779824401&_gid=218034169.1592772062&gjid=52807921&_v=j83&z=1610133504
2020-06-21T20:41:03.025Z proxied: www.googletagmanager.com/gtag/js?id=UA-55446531-20
2020-06-21T20:41:03.096Z proxied: www.googletagmanager.com/gtag/js?id=UA-55446531-20
2020-06-21T20:41:03.184Z proxied: www.googletagmanager.com/gtag/js?id=UA-55446531-20
2020-06-21T20:41:03.425Z proxied: www.google-analytics.com/r/collect?v=1&_v=j83&a=1390828066&t=pageview&_s=1&dl=https%3A%2F%2Fwww.freecodecamp.org%2Fnews%2Fhow-to-delete-a-git-branch-both-locally-and-remotely%2F&dr=https%3A%2F%2Fwww.google.com%2F&ul=en-us&de=UTF-8&dt=How%20to%20Delete%20a%20Git%20Branch%20Both%20Locally%20and%20Remotely&sd=30-bit&sr=1680x1050&vp=918x948&je=0&_u=AACAAUAB~&jid=953499377&gjid=1340825163&cid=1651878937.1592524654&tid=UA-55446531-20&_gid=1139165038.1592753739&_r=1&gtm=2ou6a0&z=1634154742&uip=108.26.
// Load testing of http-proxy node library.
// $ docker run -it --rm bash:4.4
// $ docker run -it --rm node:12-alpine sh
// # mkdir -p /test && cd /test && wget https://github.com/tsenart/vegeta/releases/download/v12.8.3/vegeta-12.8.3-linux-amd64.tar.gz && tar -xvf vegeta-12.8.3-linux-amd64.tar.gz
// # wget -O - https://gist.githubusercontent.com/ZitRos/c0d0ea80c0de4d018121c80c5d2c3653/raw/node-http-proxy-load-test.js > index.js && npm install http-proxy
// # node index.js & sleep 0.5 && echo 'GET http://localhost/favicon.ico' | ./vegeta attack -rate 15 -duration 5s | ./vegeta report -every 1s && pkill node
const http = require('http');
const httpProxy = require('http-proxy');