Skip to content

Instantly share code, notes, and snippets.

@paulmillr
paulmillr / active.md
Last active Jun 10, 2021
Most active GitHub users (by contributions). http://twitter.com/paulmillr
View active.md

Most active GitHub users (git.io/top)

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Tue, 06 Dec 2016 17:06:46 GMT till Wed, 06 Dec 2017 17:06:46 GMT.

Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

githubUsers
  .filter(user => user.followers > 1000)
View secp256k1-endomorphism.md

Hal Finney's explanation of secp256k1 "efficiently computable endomorphism" parameters used secp256k1 libraries, archived from source.

The same optimization could be applied to any Koblitz curve (e.g. Short Weistrass curve with a=0).


I implemented an optimized ECDSA verify for the secp256k1 curve, based on pages 125-129 of the Guide to Elliptic Curve Cryptography, by Hankerson, Menezes and Vanstone. I own the book but I also found a PDF on a Russian site which is more convenient.

secp256k1 uses the following prime for its x and y coordinates:

@paulmillr
paulmillr / scroll-listener.js
Created Jul 15, 2012
60FPS onscroll event listener
View scroll-listener.js
(function() {
var lastScrollY = 0;
var ticking = false;
var update = function() {
// do your stuff
ticking = false;
};
var requestTick = function() {
@paulmillr
paulmillr / generate-gradient-steps-css.js
Last active May 19, 2021
Generate gradient steps for CSS with javascript
View generate-gradient-steps-css.js
var transitionColor = function(from, to, count) {
var div = count + 1;
var int = parseInt(from, 16); // 100
var intTo = parseInt(to, 16); // 50
var list = []; // 5
var diff = int - intTo; // 50
var isNegative = diff < 0; // false
var one = diff / div; // 10
list.push(from);
@paulmillr
paulmillr / dart.md
Last active Apr 23, 2021
Leaked internal google dart email
View dart.md

---------- Forwarded message ----------

From: Mark S. Miller <erights@google.com>
Date: Tue, Nov 16, 2010 at 3:44 PM
Subject: "Future of Javascript" doc from our internal "JavaScript Summit"
last week
To: javascript-standard@google.com
View parallel_grep.rs
use std::env::args;
use std::fs::File;
use std::io::{BufRead, BufReader};
use std::path::Path;
use std::thread;
// grep 6 times faster than unix `grep` CLI
fn read_print(filename: String, matcher: String) {
let path = Path::new(&filename);
View base32.ts
// https://www.rfc-editor.org/rfc/rfc4648.txt
const ALPHABET = 'abcdefghijklmnopqrstuvwxyz234567';
export function encode(data: Uint8Array): string {
let bits = 0;
let cur = 0;
let output = '';
for (let i = 0; i < data.length; i++) {
cur = (cur << 8) | data[i];
bits += 8;
@paulmillr
paulmillr / github-languages-stats.json
Last active Jan 31, 2021
Most active GitHub users raw data
@paulmillr
paulmillr / unicode_transformer.py
Created Sep 24, 2011
A plugin for Sublime Text 2 that replaces some symbols with their unicode equivalents.
View unicode_transformer.py
# encoding: utf-8
import sublime
import sublime_plugin
class UnicodeTransformer(sublime_plugin.EventListener):
"""The transfrormer was tested with CoffeeScript code."""
_just_io = False # Determines if the file was just loaded / saved.
_is_saving = False
@paulmillr
paulmillr / blst-benchmarks.txt
Last active Oct 28, 2020
blst bls12-381 benchmarks @ 29 Oct 2020, Core i9-8950HK 2.9GHz, rust
View blst-benchmarks.txt
verify_multi_aggregate/verify_multi_aggregate/8
time: [2.3732 ms 2.4034 ms 2.4348 ms]
Found 2 outliers among 100 measurements (2.00%)
2 (2.00%) high mild
verify_multi_aggregate/verify_multi_aggregate/16
time: [3.4727 ms 3.4913 ms 3.5106 ms]
verify_multi_aggregate/verify_multi_aggregate/32
time: [5.8451 ms 5.8785 ms 5.9125 ms]
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high mild