Skip to content

Instantly share code, notes, and snippets.

View pboksz's full-sized avatar

Phillip Boksz pboksz

View GitHub Profile
@pboksz
pboksz / ubuntu-server-install-rails.md
Last active December 11, 2015 13:08
@sickill's blog post on blog.lunarlogicpolska.com

Setting up fresh Ubuntu server for Ruby on Rails

Once in a while you, as a Ruby developer, are faced with product owner's "Alright, now it's time to make it live". And then you probably think "I'll be fighting with these stubborn servers for next few days...". If you have very simple app or one at the early stages of its lifetime you can use one of "no hassle deployment" platforms like Heroku or OpenShift. But chances are you need some custom stuff that is hard to achieve on these kind of platforms or you just feel better with "root" access.

You have many options for setting up Linux servers. Amongst the most popular ones are Chef and Puppet. Various hosting provider also add their own solutions for provisioning boxes (like Stackscripts on Linode). Or you can do it "the old-school way", manually. If you don't need multiple machines and/or you have just a simple Rails sit

@pboksz
pboksz / installing-ruby-using-rvm.md
Last active December 24, 2024 21:49
How to install Ruby with RVM based on @sickill's blog post

Installing Ruby using RVM

Remove RVM from apt-get (possibly)

$ apt-get --purge remove ruby-rvm
$ sudo rm -rf /usr/share/ruby-rvm /etc/rvmrc /etc/profile.d/rvm.sh

Install RVM

Make sure you have curl command installed:

@pboksz
pboksz / creating-new-rails-app.md
Last active June 18, 2018 15:21
A write-up about creating a new Rails app with Rspec, Backbone, Jasmine and many more pre-configured gems

Creating a new Rails app with Rspec, Backbone, Jasmine

NOTE: This guide assumes that you already have ruby, rails, and mysql installed on your machine, and have an IDE or code editing tool (VIM!) all ready to go.

Creating the app

First thing's first. Rails makes it nice and simple to create a new app with the proper directory structure (lets assume we are calling this app “luna” and our directory with projects is “projects”):

$ cd projects
$ rails new luna
@pboksz
pboksz / installing-java7-sdk-on-ubuntu.md
Last active December 11, 2015 19:38
Installing Java7 SDK on Ubuntu

I found this super simple installation guide to get java7 from oracle onto any Ubuntu installation here and would like to shorten it up in a gist:

Install the ppa repo, update apt-get and install java7:

$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java7-installer

Check if it installed correctly:

@pboksz
pboksz / useful-git-commands.md
Last active December 12, 2015 07:49
Some neat git tricks that I use a lot.

##When commits are still local

####Adding or changing a file to the most recent commit

git add <file-name>
git commit --amend

####Fixing the most recent commit's message

@pboksz
pboksz / upgrade-rails-version.sh
Last active December 15, 2015 07:18
A little script to upgrade rails from version to version for a project that has rspec and cucumber specs
#!/bin/bash
function checkParams() {
if [[ ! $1 || ! $2 ]]
then
echo "use like this: ./upgrade-rails.sh <path-to-rails-project> <rails-version>..."
exit 0
fi
}
function cdToPath() {
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
angular.module('appp', ['ngResource']).value('$anchorScroll', angular.noop)
# override to $anchorScroll functionality
angular.module('badgerbadger').run [
'$rootScope', '$window', ($rootScope, $window) ->
$rootScope.$on '$routeChangeSuccess', (event, newRoute, oldRoute) ->
if somethingWhereYouKeepScroll
currentScroll = $('body').scrollTop()
$window.scrollTo(0, currentScroll || 0)
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
sudo apt-get update
sudo apt-get install mongodb-10gen
sudo rm /var/lib/mongodb/mongod.lock
sudo service mongodb restart