Skip to content

Instantly share code, notes, and snippets.

View alessioalex's full-sized avatar

Alexandru Vlăduţu alessioalex

View GitHub Profile
@alessioalex
alessioalex / domtokenlist.js
Created October 22, 2021 19:17 — forked from ShirtlessKirk/domtokenlist.js
DOMTokenList polyfill for IE < 9; implements element.classList
/**
* Polyfill of DOMTokenList for IE < 9
* Monkey patch of .add, .remove for IE 10 / 11, Firefox < 26 to support multiple arguments
* Monkey patch of .toggle for IE 10 / 11, Firefox < 24 to support second argument
*/
/*global define: false, module: false */
/*jslint nomen: true */
(function domTokenListModule(global, definition) { // non-exporting module magic dance
'use strict';
@alessioalex
alessioalex / index.html
Created August 22, 2021 22:10
Multiple docs opened in parallel // source https://jsbin.com/xogirokofe
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Multiple docs opened in parallel</title>
<style id="jsbin-css">
html, body, .container {
height: 100%;
}
@alessioalex
alessioalex / htmldiff.js
Created January 31, 2021 16:11 — forked from bcks/htmldiff.js
htmldiff
(function() {
var Match, calculate_operations, consecutive_where, create_index, diff, find_match, find_matching_blocks, html_to_tokens, is_end_of_tag, is_start_of_tag, is_tag, is_whitespace, isnt_tag, op_map, recursively_find_matching_blocks, render_operations, wrap;
is_end_of_tag = function(char) {
return char === '>';
};
is_start_of_tag = function(char) {
return char === '<';
};
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<pre id='display-panel'></pre>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<h3>Check your console to see the output, press F12 and go to the console tab.</h3>
@alessioalex
alessioalex / index.html
Created February 7, 2019 11:51
JS Bin example1 // source https://jsbin.com/kuhukal
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="example1">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<h3>Check your console to see the output, press F12 and go to the console tab.</h3>
@alessioalex
alessioalex / index.html
Created February 7, 2019 11:49
JS Bin example1 // source https://jsbin.com/kuhukal
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="example1">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<h3>Check your console to see the output, press F12 and go to the console tab.</h3>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
@alessioalex
alessioalex / swarmchat.html
Created September 18, 2018 21:08
swarmchat.html
<html>
<head>
<style>
.lines { height: 20em; }
input[type="text"] {
width: 500px;
padding: 5px;
}
</style>
@alessioalex
alessioalex / sjcl-example.js
Created July 11, 2018 12:52 — forked from yetanotherchris/sjcl-example.js
Stanford Javascript Crypto Library basic AES example
// Basic AES example using the defaults.
// https://github.com/bitwiseshiftleft/sjcl
var password = "password";
var text = "my secret text";
var parameters = { "iter" : 1000 };
var rp = {};
var cipherTextJson = {};
sjcl.misc.cachedPbkdf2(password, parameters);