Skip to content

Instantly share code, notes, and snippets.

View aquilax's full-sized avatar
💭
Fighting entropy

Evgeniy Vasilev aquilax

💭
Fighting entropy
View GitHub Profile
@skanev
skanev / dev-bg.ts
Created June 21, 2023 17:39
Dev BG example code
console.log('baba')
// 1. Literal types
{
let meta: 'foo' = 'foo'
meta = 'foo'
// @ts-expect-error
meta = 'bar'

Displaying images in the terminal with tput and echo

output

Requires ImageMagick, easily available from your favorite package manager. Tested on Linux and OSX
convert image.png -resize 40 txt:-|sed -E 's/://;s/\( ? ?//;s/, ? ?/,/g;s/\)//;s/([0-9]+,[0-9]+,[0-9]+),[0-9]+/\1/g;s/255/254/g;/mage/d'|awk '{print $1,$2}'|sed -E 's/^0,[0-9]+ /print "echo;tput setaf "\;/;s/^[0-9]+,[0-9]+ /print "tput setaf ";/;s/(.+),(.+),(.+)/\1\/42.5*36+\2\/42.5*6+\3\/42.5+16/'|bc|sed 's/$/;echo -n "  ";/'|tr '\n' ' '|sed 's/^/tput rev;/;s/; /;/g;s/$/tput sgr0;echo/'|bash
@StanAngeloff
StanAngeloff / README.md
Last active December 10, 2015 12:38
Disable services in Ubuntu permanently (legacy `rc.d` and Upstart init jobs).

Disabling these services shove off about 5-10 seconds in boot time. Results will vary.

$ ./service-disable.sh mongod mongodb apache2 mysql memcached postfix qemu-kvm palm-novacomd lxc lxc-net quasselcore nfs-kernel-server