Skip to content

Instantly share code, notes, and snippets.

View lidel's full-sized avatar
📵
it may take time before I get back to you

Marcin Rataj lidel

📵
it may take time before I get back to you
View GitHub Profile
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
module.metadata = {
"stability": "unstable"
};
let usingJSON = false;

Keybase proof

I hereby claim:

  • I am lidel on github.
  • I am lidel (https://keybase.io/lidel) on keybase.
  • I have a public key whose fingerprint is 9971 97D7 8B2D 5ED7 43FC B65D 222B 6784 D5A7 9E42

To claim this, I am signing this object:

@lidel
lidel / progfun-week-001
Created April 10, 2013 17:48
Exercises in Scala, Week 1
package recfun
import common._
import scala.annotation.tailrec
object Main {
def main(args: Array[String]) {
println("Pascal's Triangle")
for (row <- 0 to 10) {
for (col <- 0 to row)
print(pascal(col, row) + " ")
@lidel
lidel / _hidden-service-watchdog.sh
Last active October 11, 2016 17:20
Simple watchdog for local Tor Hidden Service
#!/bin/bash
# fail early, be verbose
set -o errexit -o nounset -o xtrace
# confirm the service on port 22 is routable, bounce tor node if no success in 10 seconds
nc.openbsd -v -z -w 10 -x 127.0.0.1:9050 $(cat /var/lib/tor/hidden_service/hostname) 22 || (service tor restart; exit 1)
@lidel
lidel / ipfs-migration-to-cidv1b32.md
Last active January 31, 2020 23:41
Bird's-eye view of work related to IPFS moving to CIDv1 (https://github.com/ipfs/ipfs/issues/337)
@lidel
lidel / github-downloads-ipfs-desktop.sh
Created November 17, 2020 16:25
Total Number of downloads in ipfs-desktop repo
# Note this is both downloads of install packages
# AND downloads of latest.yml manifest files used by autoupdate on Windows and macOS
curl -s https://api.github.com/repos/ipfs-shipyard/ipfs-desktop/releases | egrep 'download_count' | cut '-d:' -f 2 | sed 's/,/+/' | xargs echo | xargs -I N echo N 0 | bc
@lidel
lidel / chrome-web-store-extension.user-count.sh
Created December 16, 2020 13:40
Exact user count at Chrome Web Store
# while Google does not provide official API and Stats are available only after login,
# for some reason exact user count is included on the listing page ¯\_(ツ)_/¯
curl -s https://chrome.google.com/webstore/detail/ipfs-companion/nibjojkomfdiaoajekhjakgkdhaomnch | grep -Po '<Attribute name="user_count">\K[[:digit:]]*'
@lidel
lidel / mozilla-addons.user-count.sh
Created December 16, 2020 13:56
Exact user count at AMO
# Stats on AMO are available only after login,
# but the user count is included on the listing page ¯\_(ツ)_/¯
curl -s https://addons.mozilla.org/en-US/firefox/addon/ipfs-companion/ | grep -Po '<dd class="MetadataCard-content">\K[[:digit:],]+(?=</dd><dt class="MetadataCard-title">Users</dt>)' | sed 's/,//g'
@lidel
lidel / http-compression-check.sh
Created July 12, 2019 12:11
Quick script to check if HTTP server supports compression
#!/bin/bash
set -euo pipefail
if [ $# -ne 1 ]; then
echo 1>&2 "Usage: $0 URL"
exit 3
fi
echo "Checking $1"