##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
cd /etc/ssl | |
openssl genrsa -des3 -passout pass:x -out server.pass.key 2048 | |
openssl rsa -passin pass:x -in server.pass.key -out server.key | |
rm server.pass.key | |
openssl req -new -key server.key -out server.csr | |
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt | |
rm server.csr |
sudo rm /var/lib/mongodb/mongod.lock | |
sudo service mongodb restart |
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 |
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 add-apt-repository ppa:chris-lea/node.js | |
sudo apt-get update | |
sudo apt-get install nodejs |
#!/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() { |
##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
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:
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.
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