Skip to content

Instantly share code, notes, and snippets.

View pboksz's full-sized avatar

Phillip Boksz pboksz

View GitHub Profile
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
@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() {
@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 / 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 / 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-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: