Skip to content

Instantly share code, notes, and snippets.

View 0x04's full-sized avatar

Oliver Kühn 0x04

View GitHub Profile
@0x04
0x04 / Zerofill.html
Created December 17, 2013 19:38
(Zero)fill
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>(Zero)fill</title>
</head>
<body>
<script type="text/javascript">
/**
@0x04
0x04 / to_mans.js
Created September 16, 2019 17:13
Converts A-Z to Mathematical Alphanumeric Symbols
// Converts A-Z to Mathematical Alphanumeric Symbols
const toMANS = (s, t = 0) => s.replace(/[a-z]/gi, c => String.fromCodePoint(119808 + t * 52 + c.charCodeAt(0) - (c.charCodeAt(0) < 97 ? 65 : 71)));
// Test
for (let i = 0; i < 13; i++) console.log(toMANS('Hello World!', i));
// Output
// > 𝐇𝐞𝐥𝐥𝐨 𝐖𝐨𝐫𝐥𝐝!
// > 𝐻𝑒𝑙𝑙𝑜 𝑊𝑜𝑟𝑙𝑑!
// > 𝑯𝒆𝒍𝒍𝒐 𝑾𝒐𝒓𝒍𝒅!
@0x04
0x04 / jumble_letters.js
Created September 16, 2019 20:23
Jumble letters - Except the first and last one, to keep it readable
// Jumble letters - Except the first and last one, to keep it readable
const jumbleWord = m => m[0] + [...m.substr(1, m.length - 2)].reverse().sort(() => Math.round(Math.random())).join('') + m[m.length - 1];
const jumbleText = (t, i = 3) => t.replace(/\b\w(\w{2,})\w\b/gi, m => [...Array(i)].map(_ => jumbleWord(m)).find(e => e != m) || m);
// Test
let testText = "It doesn't matter in what order the letters in a word are, the only important\n"
+ "thing is that the first and last letter be at the right place. The rest can\n"
+ "be a total mess and you can still read it without problem. This is because\n"
+ "the human mind does not read every letter by itself, but the word as a whole."
document.getElementById('siteNotice').remove();
document.querySelector('link[href^="/w/load.php?lang=de&modules=site.styles&only=styles&skin=vector"]').remove()
@0x04
0x04 / StringUtil.as
Last active February 25, 2020 13:00
package com.utils
{
public class StringUtil {
static public function padStart(string:String, length:uint, padString:String = ' '):String {
var insert:String = '';
for (var i:int = 0; i < length; i++) {
insert += padString;
}
var hackInput = document.querySelector('#inputfield')
var hackHighlight = null
var hackCurrent = 0
var hackInterval = 0
function hack() {
hackHighlight = document.querySelector('#row1 .highlight')
if (!hackHighlight) {
clearInterval(hackInterval)
/**
* Returns the internal class name of the given object.
* @private
* @param {*} value
* @param {String} [compare]
* @returns {Boolean|String}
*/
function _is(value, compare)
{
var type = Object.prototype.toString.call(value);

Collected/created React code snippets

@0x04
0x04 / vim.md
Last active May 24, 2020 16:01
VIM config/plugins
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.