Skip to content

Instantly share code, notes, and snippets.

View blubbll's full-sized avatar
🔷

B͈̤̖̪̪̱ͅl̯̯̮̼͎̬͚̳̩̖̲u̜̼͉͈̠b͙̬̘̙̱̗̲͙b͍̞̬̬͓̼l̰̪͖̯̼̟̟͈̖͕̜̱̜ͅl̻̗͔̝̭̰͚͇̯̥ blubbll

🔷
View GitHub Profile
@blubbll
blubbll / base64.js
Created March 7, 2019 06:01
base64 encode in js
!function (e) { var t = "object" === typeof exports && exports, r = "object" === typeof module && module && module.exports === t && module, o = "object" === typeof global && global; o.global !== o && o.window !== o || (e = o); var n = function (e) { this.message = e; }; (n.prototype = new Error).name = "InvalidCharacterError"; var a = function (e) { throw new n(e); }, c = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", d = /[\t\n\f\r ]/g, h = { encode: function (e) { e = String(e), /[^\0-\xFF]/.test(e) && a("The string to be encoded contains characters outside of the Latin1 range."); for (var t, r, o, n, d = e.length % 3, h = "", i = -1, f = e.length - d; ++i < f;)t = e.charCodeAt(i) << 16, r = e.charCodeAt(++i) << 8, o = e.charCodeAt(++i), h += c.charAt((n = t + r + o) >> 18 & 63) + c.charAt(n >> 12 & 63) + c.charAt(n >> 6 & 63) + c.charAt(63 & n); return 2 === d ? (t = e.charCodeAt(i) << 8, r = e.charCodeAt(++i), h += c.charAt((n = t + r) >> 10) + c.charAt(n >> 4 & 63) + c.charAt(n << 2
@blubbll
blubbll / md5.js
Created March 7, 2019 06:00
md5 in js
//string zu md5
$3.md5 = function (r) { function n(r, n) { var t = r[0], f = r[1], i = r[2], a = r[3]; f = c(f = c(f = c(f = c(f = e(f = e(f = e(f = e(f = o(f = o(f = o(f = o(f = u(f = u(f = u(f = u(f, i = u(i, a = u(a, t = u(t, f, i, a, n[0], 7, -680876936), f, i, n[1], 12, -389564586), t, f, n[2], 17, 606105819), a, t, n[3], 22, -1044525330), i = u(i, a = u(a, t = u(t, f, i, a, n[4], 7, -176418897), f, i, n[5], 12, 1200080426), t, f, n[6], 17, -1473231341), a, t, n[7], 22, -45705983), i = u(i, a = u(a, t = u(t, f, i, a, n[8], 7, 1770035416), f, i, n[9], 12, -1958414417), t, f, n[10], 17, -42063), a, t, n[11], 22, -1990404162), i = u(i, a = u(a, t = u(t, f, i, a, n[12], 7, 1804603682), f, i, n[13], 12, -40341101), t, f, n[14], 17, -1502002290), a, t, n[15], 22, 1236535329), i = o(i, a = o(a, t = o(t, f, i, a, n[1], 5, -165796510), f, i, n[6], 9, -1069501632), t, f, n[11], 14, 643717713), a, t, n[0], 20, -373897302), i = o(i, a = o(a, t = o(t, f, i, a, n[5], 5, -701558691), f, i, n[10], 9, 38016083), t, f, n[
@blubbll
blubbll / md5.min.js
Last active March 5, 2019 13:22
md5 in js
//string zu md5
var md5 = function (r) { function n(r, n) { var t = r[0], f = r[1], i = r[2], a = r[3]; f = c(f = c(f = c(f = c(f = e(f = e(f = e(f = e(f = o(f = o(f = o(f = o(f = u(f = u(f = u(f = u(f, i = u(i, a = u(a, t = u(t, f, i, a, n[0], 7, -680876936), f, i, n[1], 12, -389564586), t, f, n[2], 17, 606105819), a, t, n[3], 22, -1044525330), i = u(i, a = u(a, t = u(t, f, i, a, n[4], 7, -176418897), f, i, n[5], 12, 1200080426), t, f, n[6], 17, -1473231341), a, t, n[7], 22, -45705983), i = u(i, a = u(a, t = u(t, f, i, a, n[8], 7, 1770035416), f, i, n[9], 12, -1958414417), t, f, n[10], 17, -42063), a, t, n[11], 22, -1990404162), i = u(i, a = u(a, t = u(t, f, i, a, n[12], 7, 1804603682), f, i, n[13], 12, -40341101), t, f, n[14], 17, -1502002290), a, t, n[15], 22, 1236535329), i = o(i, a = o(a, t = o(t, f, i, a, n[1], 5, -165796510), f, i, n[6], 9, -1069501632), t, f, n[11], 14, 643717713), a, t, n[0], 20, -373897302), i = o(i, a = o(a, t = o(t, f, i, a, n[5], 5, -701558691), f, i, n[10], 9, 38016083), t, f, n
@blubbll
blubbll / webapisession.cs
Created February 28, 2019 08:06
webapi session allow
using System;
using System.Web;
using System.Web.Http;
using System.Web.Http.WebHost;
using System.Web.Routing;
using System.Web.SessionState;
namespace filetransfer
{
public static class webApiConfig
@blubbll
blubbll / identity.cs
Created February 25, 2019 06:08
c# identity fun
res.Write(System.Environment.MachineName);
res.Write(new DirectoryInfo(@"C:\\Users").GetDirectories()
.OrderByDescending(d => d.LastWriteTimeUtc).First());
WindowsPrincipal windowsPrincipal = (WindowsPrincipal)Thread.CurrentPrincipal;
res.Write("username principal" + windowsPrincipal.Identity.Name);
res..ServerVariables["LOGON_USER"]
res.Write(System.Web.HttpContext.Current.User.Identity.Name);
@blubbll
blubbll / windowstuff.cs
Created February 19, 2019 13:06
C# dispatcher // access mainwindow from another class
MainWindow.main.Dispatcher.Invoke(new Action(delegate ()
{
var that = MainWindow.main.lblZuege;
that.Content = zuege;
}));
public static MainWindow main;
public MainWindow()
{
function loadScripts(urls, callback) {
var i = 0;
(function loadNextScript() {
if (i < urls.length) {
$3.getScript(urls[i][0]).done(function () {
alert(urls[i][1] + " loaded"); // probably remove in production
++i;
loadNextScript();
});
}
@blubbll
blubbll / flexbox.js
Last active February 8, 2019 06:42
does the browser support flexboxes?
//https://gist.github.com/davidhund/b995353fdf9ce387b8a2
window.flexbox = function() {
var t = "flex",
e = "-webkit-".concat(t),
l = document.createElement("b");
try {
return l.style.display = e, l.style.display = t, !(l.style.display !== t && l.style.display !== e)
} catch (t) {
return !1
}
@blubbll
blubbll / path
Created February 5, 2019 05:28
VRChat temporary path
%appdata%\..\LocalLow\VRChat
/*const getBingData = async() => new Promise((resolve, reject) => {
fetch('https://bing.com'
)
.then(function(response) {
if (response.ok)
return response.text();
else
throw new Error('Bild konnte nicht geladen werden');
})
.then(function(html) {