Skip to content

Instantly share code, notes, and snippets.

View lloydmeta's full-sized avatar
🏠
Working from home

Lloyd lloydmeta

🏠
Working from home
View GitHub Profile
@lloydmeta
lloydmeta / loop.rs
Last active September 10, 2017 02:54 — forked from xevix/loop.rs
pub fn combine_all_option<T>(xs: &Vec<T>) -> Option<T>
where
T: Semigroup + Clone,
{
xs.iter().skip(1).fold(
xs.first().map(|v| v.clone()),
|acc, next| acc.map(|v| v.combine(next)),
)
}
@lloydmeta
lloydmeta / gist:8294943
Last active January 2, 2016 11:09 — forked from futuremill-ltd/gist:2318876
Building a Debian package for installing Ruby 1.9.3 -p484 for Ubuntu 11.10. Adapted from the one for Debian Squeeze
# From a fresh install of Debian
sudo apt-get install ruby rubygems # Need ruby to use fpm
sudo gem1.8 install fpm --no-ri --no-rdoc
sudo apt-get install build-essential openssl libreadline6 libreadline6-dev zlib1g zlib1g-dev libssl-dev ncurses-dev libyaml-dev
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p484.tar.gz
tar -zxvf ruby-1.9.3-p484.tar.gz
cd ruby-1.9.3-p484
rm -rf /tmp/ruby193