Skip to content

Useful Code Snippets

Rob Ruana edited this page Feb 3, 2018 · 16 revisions

Make Any '<form>' an ajax-form

Add the following

<script>
$("#formID").ajaxForm(function(message){
    toastr.info(message);
    setTimeout(function(){
        location.reload(true);
    }, 1500);
});
</script>

Bower/Grunt install

Run the following

sudo apt-get install npm
cd ~/uber/sideboard/plugins/uber
sudo npm install -g bower
npm install grunt # Possibly unnecessary?
sudo npm install -g grunt-cli
sudo ln -s /usr/bin/nodejs /usr/bin/node
bower install
npm install grunt-bower-concat # Fails on Windows, see note below
grunt

The Apply Node command

When upgrading Reggie the Registration system you can use the following sh file

uber/puppet/apply_node.sh localhost

Once completed use sep reset_uber_db to drop all the database tables

Turn off the Uber Daemon

Are you getting an error stating that Port 8282 is not free on 0.0.0.0? SSH into your vagrant instance and use the command sudo supervisorctl stop all

Clear NGINX Cache

As root:

find /var/cache/nginx/**/* -type f | xargs rm

Completely Wipe Out Database

DROP SCHEMA public CASCADE;
CREATE SCHEMA IF NOT EXISTS public AUTHORIZATION rams_db;
GRANT ALL ON SCHEMA public TO public;
GRANT ALL ON SCHEMA public TO rams_db;

I have an error, what's going on?!

Check the logs located at /var/log/uber-app.log

Clone this wiki locally