Skip to content

Instantly share code, notes, and snippets.

View haffla's full-sized avatar
🌵
Mezcal

Jakob Pupke haffla

🌵
Mezcal
View GitHub Profile
@haffla
haffla / delete_old_docker_containers_images.txt
Created October 6, 2016 11:43
Remove old Docker containers and images
CONTAINERS:
docker ps -a | grep 'weeks ago' | awk '{print $1}' | xargs --no-run-if-empty docker rm
IMAGES:
docker rmi $(docker images --filter "dangling=true" -q --no-trunc)
@haffla
haffla / tr.rb
Last active November 3, 2016 12:10
Truncate only text
def truncateOnlyText t, p
r = %r{<[^<]+>[^<]+</[^<]+>}
h = %r{<[^<]+>}
k = /(?<=>).+(?=<)/
z = []
s = t.gsub(h, '')[0,p]
t.scan(r) do |c|
z << [c, $~.offset(0)[0]]
end
p z

Keybase proof

I hereby claim:

  • I am haffla on github.
  • I am jak_p (https://keybase.io/jak_p) on keybase.
  • I have a public key ASCBxzX-YbrZ-bLd0zKGE4F_KjMqoq7dCbjODbqfVx2tAAo

To claim this, I am signing this object:

# frozen_string_literal: true
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'json'
gem 'tty-option'
gem 'tty-prompt'
end