This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name removeappreference | |
// @namespace numen | |
// @include https://www.youtube.com/* | |
// @include https://youtube.com/* | |
// @include http://www.youtube.com/* | |
// @include http://youtube.com/* | |
// @include https://m.youtube.com/* | |
// @include http://m.youtube.com/* | |
// @version 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Minimal implementation of the TAR file format. | |
* Reference: | |
* https://www.freebsd.org/cgi/man.cgi?query=tar&sektion=5 | |
*/ | |
export class Tar { | |
private data: Map<string, Blob> = new Map(); | |
/** Add a file to the archive. | |
* @param {string} fileName - file name (including directory structure) | |
* @param {Blob} contents |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getJaccardSimilarity(item, otherItem) { | |
function makeUnique(prev, current, index) { | |
return (index === 1 | |
? [prev].concat(prev !== current ? current : []) // handle when first two items are identical | |
: (prev.indexOf(current) > -1 | |
? prev | |
: (prev.push(current), prev))) | |
} | |
const union = [].concat(item.split(/\s+/)).concat(otherItem.split(/\s+/)).reduce(makeUnique); | |
const otherUnique = otherItem.split(/\s+/).reduce(makeUnique); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function makeUnique(prev, current, index) { | |
return (index === 1 | |
? [prev].concat(prev !== current ? current : []) // handle when first two items are identical | |
: (prev.indexOf(current) > -1 | |
? prev | |
: (prev.push(current), prev))) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[... document.querySelectorAll(".file td")] | |
.map(td => | |
td.firstChild | |
? td.firstChild.textContent | |
= td.firstChild.textContent | |
.replace( | |
/^(\t+)/, | |
(match, p1) => | |
" ".repeat(4).repeat(p1.length)) | |
: "") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const rq = require("http"); | |
const url = "http://www.bamosz.hu/alapoldal?isin=HU0000711353"; | |
const htmlParser = require("htmlparser"); | |
const parseHtml = function(html) { | |
return new Promise((resolve, reject) => { | |
(new htmlParser.Parser( | |
new htmlParser.DefaultHandler( | |
(error, dom) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat *.html | sed -e 's/<[^>]\+>//g' -e 's/[ \t]\+/\n/g' -e 's/[-\.\\(\\):,;0-9+|]//g'|sort | uniq -ci | sort -h | |
cat *.html | \ # all the files' contents | |
sed -e 's/<[^>]\+>//g' \ # without tags (assumes they don't contain line breaks) | |
-e 's/[ \t]\+/\n/g' \ # replace tabs and spaces with line breaks | |
-e 's/[^a-z]//gi' | \ # remove some non-letters ( | |
sort | \ # sort once to make uniq work | |
uniq -ci | \ # show occurrence counts, case insensitive | |
sort -h # sort by numbers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# list from https://hu.wikipedia.org/wiki/Magyar_n%C3%A9vnapok_list%C3%A1ja_d%C3%A1tum_szerint | |
echo $(grep `date +%m/%d` $0) napja van | |
exit | |
01/01 Alpár Fruzsina Bazil | |
01/02 Ábel Gergely Vazul | |
01/03 Genovéva Gyöngyvér Benjámin Dzsenifer ((Jennifer)) | |
01/04 Titusz Leona Angéla | |
01/05 Simon Emília | |
01/06 Gáspár Menyhért Boldizsár |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MIT License | |
Copyright (c) 2009-2016, Bálint Erdősi | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* code based on pseudocode from https://en.wikipedia.org/wiki/Wagner%E2%80%93Fischer_algorithm#Calculating_distance */ | |
interface replacePair { | |
first: string; | |
second: string; | |
cost: number | |
} | |
class replacePairCollection { | |
replacePairs: Array<replacePair>; |