Skip to content

Instantly share code, notes, and snippets.

@anvaka
anvaka / panzoom.md
Created August 25, 2018 19:47
Pan and zoom

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 November 21, 2016 15:56
Javascript communities to find news and share yours
@anvaka
anvaka / top100.md
Last active February 10, 2024 02:24
The most popular keywords in modern research
# 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
@anvaka
anvaka / 00.Intro.md
Last active December 12, 2024 01:19
npm rank

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
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 February 27, 2015 04:01
just a page rank perf
// 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 January 16, 2019 14:45
npm modules with highest pagerank

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 January 10, 2015 19:36
requirebin sketch
var addWheelListener = require('wheel');
addWheelListener(document.body, function (e) {
console.log(e);
});
@anvaka
anvaka / top-github.md
Last active February 3, 2021 19:58
Top GitHub users by total number of stars

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