Skip to content

Instantly share code, notes, and snippets.

View lukashlavacka's full-sized avatar

Lukáš Hlavačka lukashlavacka

View GitHub Profile
@lukashlavacka
lukashlavacka / cpu_load.sh
Last active October 4, 2018 14:50
Converts CPU load average into 1 character unicode symbol
#!/bin/bash
sysctl -n vm.loadavg | awk '{print ($3+0 > 1) ? ($3+0 > 1.5) ? ($3+0 > 2) ? ($3+0 > 2.5) ? ($3+0 > 3) ? ($3+0 > 3.5) ? ($3+0 > 4) ? "█" : "▇" : "▆" : "▅" : "▄" : "▃" : "▂" : "▁"}'
@lukashlavacka
lukashlavacka / Prevent search and scramble copy
Last active August 29, 2015 14:03
Makes text unsearchable and copied text is scrambled
walk(document.body);
function walk(node)
{
var child, next;
switch ( node.nodeType )
{
case 1:
case 9:

Keybase proof

I hereby claim:

  • I am LukasHlavacka on github.
  • I am lukashlavacka (https://keybase.io/lukashlavacka) on keybase.
  • I have a public key whose fingerprint is 456F D5B5 4C88 720A 19CF B8C3 295C 2D4A A18C BCA4

To claim this, I am signing this object:

var description = {} //key value storage of values from http://www.unicode.org/Public/UNIDATA/NamesList.txt (key 4-6 hex code, value the name string)
function checkChar(c, e, f)
{
e = e || "\uD83D\uDCA9";
f = f || "monospace"
var canvas = document.createElement("canvas"),
ctx = canvas.getContext('2d');
ctx.font = "16px" + f;
ctx.fillText(e, 0, 16);