Skip to content

Instantly share code, notes, and snippets.

View mpmuc84's full-sized avatar

Maxime mpmuc84

  • Munich, Germany
View GitHub Profile
@mpmuc84
mpmuc84 / install_ruby_rpi.sh
Created October 26, 2018 17:01 — forked from blacktm/install_ruby_rpi.sh
A Bash script to install Ruby 2.5 on the Raspberry Pi (Raspbian)
#!/bin/bash
# --------------------------------------------------------------------------------------------
# Installs Ruby 2.5 using rbenv/ruby-build on the Raspberry Pi (Raspbian)
#
# Run from the web:
# bash <(curl -s https://gist.github.com/blacktm/8302741/raw/install_ruby_rpi.sh)
# --------------------------------------------------------------------------------------------
# Welcome message
@mpmuc84
mpmuc84 / gem-reset
Created August 10, 2018 11:50 — forked from nixpulvis/gem-reset
Remove all non default gems. For ruby 2.0.0
#!/usr/bin/env ruby
# Remove all gems EXCEPT defaults :)
`gem list -d`.split(/\n\n^(?=\w)/).each do |data|
match = data.match(/(?<name>([^\s]+)) \((?<versions>.*)\)/)
name = match[:name]
versions = match[:versions].split(', ')
if match = data.match(/^.*\(([\d\.]*),? ?default\): .*$/)
next if match[1].empty? # it's the only version if this match is empty