This file contains 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 format (fmt, kwargs) { | |
var args = arguments; | |
var index = 1; | |
return fmt.replace(/{([^{}]*)}|{{|}}|{|}/g, function (match, key) { | |
if (key !== undefined) { | |
if (key) { | |
return kwargs[key]; | |
} | |
else { |
This file contains 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
// Show Passwords: | |
javascript:document.querySelectorAll('input[type=password]').forEach(e=>{e.type='text';e.setAttribute('data-io-github-panzi-password','true');});void(0) | |
// Hide Passwords again: | |
javascript:document.querySelectorAll('input[data-io-github-panzi-password=true]').forEach(e=>e.type='password');void(0) |
This file contains 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
<!-- | |
This is useful in debug mode. For production you want to compile your | |
scripts down to an signle file and an old ECMAScript version. | |
--> | |
<script type="application/javascript;version=1.8"> | |
// Firefox needs application/javascript;version=1.7 or ...;version=1.8 | |
// for new ECMAScript syntax features. It will also include Mozilla-only | |
// syntax extensions, so be careful not to accidentally use those. | |
// However, other browsers don't understand that script type. |
This file contains 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
var BitField = (function () { | |
"use strict"; | |
function BitField (bits) { | |
if (Array.isArray(bits)) { | |
return BitField.fromJSON(bits); | |
} | |
else if (typeof bits === "string") { | |
return BitField.fromBase64(bits); | |
} |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Save Generated Data</title> | |
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge;chrome=1"/> | |
<script type="text/javascript"> | |
// <![CDATA[ |
This file contains 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
import axios from 'axios'; | |
import { IncomingMessage } from 'http'; | |
// browser version would use Uint8Array instead of Buffer and woudln't have stream/IncomingMessage | |
// since Buffer is a sub-class of Uint8Array you could use that in nodejs too, if you don't need any of the Buffer specific methods | |
declare module 'axios' { | |
interface AxiosInstance { | |
request(config: AxiosRequestConfig & { responseType: 'arraybuffer' }): Promise<AxiosResponse<Buffer>>; | |
request(config: AxiosRequestConfig & { responseType: 'text' }): Promise<AxiosResponse<string>>; | |
request(config: AxiosRequestConfig & { responseType: 'stream' }): Promise<AxiosResponse<IncomingMessage>>; |
This file contains 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
export default function omit<T, K extends keyof T>(obj: T, ...keys: K[]): Omit<T, K> { | |
const obj2 = { ...obj }; | |
for (const key of keys) { | |
delete obj2[key]; | |
} | |
return obj2; | |
} |
This file contains 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
# Copyright 2021 Mathias Panzenböck | |
# | |
# 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: | |
# | |
# The above copyright notice and this permission notice shall be included in all |
This file contains 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
var XML_CHAR_MAP = { | |
'<': '<', | |
'>': '>', | |
'&': '&', | |
'"': '"', | |
"'": ''' | |
}; | |
function escapeXml (s) { | |
return s.replace(/[<>&"']/g, function (ch) { |
This file contains 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
javascript:void(!function(){function e(e){for(var t=null,n=null,r=null,l=0;l<e.length;++l){var i=e[l].srcset;if(i){i=i.split(",");for(var a=0;a<i.length;++a){var o=i[a].trim().split(/\s+/g),u=o[1];if(u){var c=/^(\d+(?:\.\d*)?)([a-z])$/i.exec(u),s=c[2],d=+c[1];(s!==t||d>n)&&(t=s,n=d,r=o[0])}else r||(r=o[0],n=t=null)}}}return r?{url:r}:null}function t(t){switch(t.tagName.toUpperCase()){case"IMG":return e([t])||(t.currentSrc?{url:t.currentSrc}:t.src?{url:t.src}:null);case"CANVAS":return{url:t.toDataURL(),html:'<img src="'+t.toDataURL()+'"/>'};case"VIDEO":case"AUDIO":return t.currentSrc?{url:t.currentSrc}:null;case"SVG":var n=t.outerHTML.replace(/^<svg\b/i,e=>e+' xmlns="http://www.w3.org/2000/svg"');return{html:n,url:"data:image/svg+xml,"+encodeURIComponent(n)};case"IFRAME":if(t.src&&"about:blank"!==t.src)return{url:t.src};case"PICTURE":return e(t.querySelectorAll("source"));case"IMAGE":if("http://www.w3.org/2000/svg"===t.namespaceURI)return{url:t.href.baseVal};default:var r=getComputedStyle(t,null).backgroundIma |