Skip to content

Instantly share code, notes, and snippets.

View MightyPork's full-sized avatar
🐶
meow

Ondřej Hruška MightyPork

🐶
meow
View GitHub Profile
@MightyPork
MightyPork / utfanal.js
Last active September 9, 2017 09:13
Find unique non-ASCII characters in a UTF-8 file
let fs = require("fs");
let myArgs = process.argv.slice(2);
fs.readFile(myArgs[0], "utf8", function (err, data) {
if (err) throw err;
const ar = Array.from(data);
let table = [];
ar.forEach(function(k) {
if (k.codePointAt(0) > 127 && table.indexOf(k)<0) {
let bn = encodeURIComponent(k).replace(/%[A-F\d]{2}/g, 'U').length;
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥
################################################################################
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
................................................................................
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
────────────────────────────────────────────────────────────────────────────────

ESPTerm's binary objects

2B and 3B encoding

This encoding is used to safely transport numbers in a UTF-8 string. Essentially it's a Base127 format with each character incremented by 1, producing a sequence of ASCII characters 1-127, LSB first.

Eg.

  • 1 -> 02h 01h in 2B encoding.
@MightyPork
MightyPork / guthub-network.userscript.js
Last active September 6, 2017 09:10
Add back link to network graph in github project nav
// ==UserScript==
// @name github network link
// @namespace http://tampermonkey.net/
// @version 0.1
// @description add back link to network graph on github
// @author MightyPork
// @match https://github.com/*/*
// @grant none
// ==/UserScript==
@MightyPork
MightyPork / uQuery.js
Created August 22, 2017 12:52
tiny inlineable query library to replace jquery
// uQuery
function qsa(q){return document.querySelectorAll(q)}
function qs(q){return document.querySelector(q)}
function bind(el,evt,fn){el.addEventListener(evt,fn)}
function qbind(q,evt,fn){var els=qsa(q);els&&els.forEach(function(el){el.addEventListener(evt, fn)})}
@MightyPork
MightyPork / codepage437rev.txt
Created August 20, 2017 21:59
codepage 437 reverse
0 0000
1 ☺ 263A
2 ☻ 263B
3 ♥ 2665
4 ♦ 2666
5 ♣ 2663
6 ♠ 2660
7 • 2022
8 ◘ 25D8
9 ○ 25CB
@MightyPork
MightyPork / codepage437.txt
Last active August 20, 2017 21:56
codepage 437
0000 0
263A ☺ 1
263B ☻ 2
2665 ♥ 3
2666 ♦ 4
2663 ♣ 5
2660 ♠ 6
2022 • 7
25D8 ◘ 8
25CB ○ 9
:grinning:
:grin:
:joy:
:rofl:
:smiley:
:smile:
:sweat_smile:
:laughing:
:wink:
:blush:
Index: app/javascript/mastodon/components/media_gallery.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- app/javascript/mastodon/components/media_gallery.js (revision f2233c3e25bd52388798e5d76311896fa8029413)
+++ app/javascript/mastodon/components/media_gallery.js (revision )
@@ -173,6 +173,7 @@
onOpenMedia: PropTypes.func.isRequired,
intl: PropTypes.object.isRequired,
@MightyPork
MightyPork / mastodon-instance-filter.js
Created May 27, 2017 16:22
mysql-like filter box for instances.mastodon.xyz
// ==UserScript==
// @name xyz instance filter
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Adds a filtering box to the instance list.
// Syntax is like JS or mysql, columns are:
// name,up,down,score,version,users,toots,connections,open,closed,uptime
//
// @author You
// @match https://instances.mastodon.xyz/list