Skip to content

Instantly share code, notes, and snippets.

Andrei Kashcha anvaka

Block or report user

Report or block anvaka

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 panzoom.md

Pan and zoom some websites.

In the browser address bar type javascript: and then paste this line

s=document.createElement("script");s.src="https://cdn.rawgit.com/anvaka/panzoom/v6.1.3/dist/panzoom.js";s.setAttribute('query','body');document.head.appendChild(s)

Note: This doesn't work on some websites with strict content security policy (like Twitter or Facebook)

@anvaka
anvaka / Readme.md
Created Nov 21, 2016
Javascript communities to find news and share yours
@anvaka
anvaka / top100.md
Last active Feb 9, 2018
The most popular keywords in modern research
View top100.md
View What's most commonly used with redux?
# Top 50 package most commonly used with redux.
react used 113 times
react-redux used 107 times
babel used 77 times
babel-core used 70 times
react-dom used 61 times
babel-loader used 61 times
webpack used 60 times
mocha used 58 times
View 00.Intro.md

npm rank

This gist is updated daily via cron job and lists stats for npm packages:

  1. Top 1,000 most depended-upon packages
  2. Top 1,000 packages with largest number of dependencies
  3. Top 1,000 packages with highest PageRank score
View jquery versions on npm
Results generated by https://github.com/anvaka/npmrank
> node countVersions.js jquery
Counting packages that depend on jquery...
[ { version: '^2.1.4', dependents: 319 },
{ version: '^2.1.3', dependents: 296 },
{ version: '^2.1.1', dependents: 239 },
{ version: '*', dependents: 121 },
{ version: '~2.1.0', dependents: 84 },
{ version: '~1.8.3', dependents: 63 },
@anvaka
anvaka / index.js
Created Feb 27, 2015
just a page rank perf
View index.js
// run:
// echo {} > package.json
// npm i byline ngraph.graph ngraph.pagerank
var byline = require('byline');
var fs = require('fs');
var g = require('ngraph.graph')();
var pagerank = require('ngraph.pagerank');
var stream = byline.createStream(fs.createReadStream('web-Google.txt', { encoding: 'utf8' }));
@anvaka
anvaka / modules.md
Last active Jan 16, 2019
npm modules with highest pagerank
View modules.md

This excercise computes PageRank of npm dependencies graph.

  1. Download all npm modules: wget https://skimdb.npmjs.com/registry/_design/scratch/_view/byField
  2. Convert them into ngraph.graph using convertToGraph.js script.
  3. Run rank.js (see below):

Number of nodes: 123,969; Number of edges: 281,471; PageRank computed in 1,187 ms;

  1. underscore - 0.0132458168541106
  2. lodash - 0.012808245947189859
@anvaka
anvaka / index.js
Created Jan 10, 2015
requirebin sketch
View index.js
var addWheelListener = require('wheel');
addWheelListener(document.body, function (e) {
console.log(e);
});
@anvaka
anvaka / top-github.md
Last active May 16, 2019
Top GitHub users by total number of stars
View top-github.md

I was playing with GitHub Archive recently. Out of curiosity I ran this query:

SELECT COUNT(repository_owner) as totalStars, repository_owner
FROM [githubarchive:github.timeline] 
WHERE type = 'WatchEvent'
GROUP BY repository_owner
ORDER BY totalStars DESC
LIMIT 1000
You can’t perform that action at this time.