Skip to content

Instantly share code, notes, and snippets.

View cefigueiredo's full-sized avatar

Carlos Figueiredo cefigueiredo

  • Montreal, Quebec
View GitHub Profile
@cefigueiredo
cefigueiredo / binary.rb
Created July 14, 2023 20:43 — forked from xfbs/binary.rb
Ruby: convert string to binary form and back (one liners
# not the most efficient way,
# but you get the idea.
str = "meow"
# convert string to binary
bin = str.bytes.map{|d| d.to_s(2)}.map{|b| b.rjust(8, '0')}.join
puts bin
# and convert it back to a string

rage-quit support for bash

HOW TO INSTALL

Put flip somewhere in your $PATH and chmod a+x it.

Copy fuck into ~/.bashrc.