Skip to content

Instantly share code, notes, and snippets.

View mpapis's full-sized avatar
🙃
I am slow to respond, ping me when it's crucial.

Michal Papis mpapis

🙃
I am slow to respond, ping me when it's crucial.
View GitHub Profile
detect_os()
{
if [[ -n "${platform:-}" ]]
then return 0
fi
platform=...
}
# will run detection only once (not 4)
detect_os
@mpapis
mpapis / gist:6391211
Last active December 22, 2015 00:39 — forked from Ch00k/gist:6391153
if
__system_and_version_is SunOS 5.10
then
if __rvm_which sudo >/dev/null 2>&1
then sudo_path=""
else sudo_path=/opt/csw/bin/
fi
else
sudo_path=""
fi
@mpapis
mpapis / Gemfile
Last active December 19, 2015 00:20 — forked from workmaster2n/Gemfile
# Just part of it
gem 'pg'
gem 'rgeo'
gem 'rgeo-shapefile'
gem 'activerecord-postgis-adapter'
gem 'paperclip'
# Just part of it
gem 'pg'
gem 'rgeo'
gem 'rgeo-shapefile'
gem 'activerecord-postgis-adapter'
gem 'paperclip'
@mpapis
mpapis / rvm_io_integration_pow.md
Created June 7, 2013 19:19
Description for integrating RVM with POW

Using RVM with POW

POW has removed automated detection of rvm, here is how it can be restored by creating .powenv in the root of the project, according to POW docs it should not be checked in to source control (unless all team members agree on that).

.powenv:

# detect `$rvm_path`

if [ -z "${rvm_path:-}" ] && [ -x "${HOME:-}/.rvm/bin/rvm" ]

@mpapis
mpapis / openbsd.patch
Last active December 18, 2015 04:49
fixing builiding ruby-1.9.3 on OpenBSD Backported from http://bugs.ruby-lang.org/issues/8406
--- configure
+++ configure
@@ -712,6 +712,7 @@
DLDFLAGS
ALLOCA
LIBOBJS
+POSTLINK
WERRORFLAG
CHDIR
RMALL
@mpapis
mpapis / setup.sh
Last active December 18, 2015 02:58
#!/usr/bin/env bash
MY_RUBY="jruby-1.7.4"
# install required packages
apt-get update
apt-get install -y build-essential git-core curl openjdk-7-jdk vim ack-grep postgresql postgresql-server-dev-9.1
# install RVM, update dot files
curl -L https://get.rvm.io | bash -s stable --auto-dotfiles
require "rvm/capistrano"
require "bundler/capistrano"
load "deploy/assets"
ssh_options[:forward_agent] = true
default_run_options[:pty] = true
set :application, "vinyl_villain"
set :scm, :git
[[ -d "/usr/local/rvm/scripts/rvm" ]] && source "/usr/local/rvm/scripts/rvm"
source ~/.bashrc
@mpapis
mpapis / gist:5391238
Last active December 16, 2015 06:28 — forked from iewnait/gist:5332536
set :stages, %w(production sandbox)
set :default_stage, "sandbox"
require 'capistrano/ext/multistage'
set :application, "blogtest"
set :repository, "git@github.com:iewnait/blogtest.git"
default_run_options[:pty] = true
set :scm, :git # You can set :scm explicitly or Capistrano will make an intelligent guess based on known version control directory names