Skip to content

Instantly share code, notes, and snippets.

Production/Staging workflow Steps
Make Heroku App for Staging
Make Heroku App for Production
Add remote for production
heroku git:remote -a <APPNAME> -r <REMOTENAME>
add remote for staging
// Change Uncommmented stuff in BikeService.service.js
// Change ctrl.bikes = BikeService.all(); in dashboard.controller
// in index.html change dash.bikes to dash.bikes.bikes
var Bike = function(options){
this.brand = options.brand || '',
this.price = options.price || 0
// FACTORY bike-factory.js
angular.module('bike-api', [])
.factory('bikeFactory', ['$http', function ($http) {
var url = 'http://localhost:8080/bike';
var bike = function () {
var self = this;
self.getDefaults().then(function (response) {
mongoose.model('text_search').findOneAndUpdate({_id: doc._id},{
name: doc['email'] + '\n' + doc['first_name'] + '\n' + doc['last_name'],
email: doc['email'],
full_name: doc['first_name'] + ' ' + doc['last_name'],
type: 'user_unassigned'
},{upsert : true}, function (err, data) {
if (err) {
console.log(err);
}
return data;
@BooneTeam
BooneTeam / if_exist_col_drop.sql
Created November 5, 2014 17:23
MYSQL Drop cols if exist
DROP PROCEDURE IF EXISTS drop_accounting_columns_from_product_categories;
DELIMITER ;;
CREATE PROCEDURE drop_accounting_columns_from_product_categories() begin
/* delete columns if they exist */
IF EXISTS( select * from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME='product_categories'
and COLUMN_NAME='volume_accounting_id') THEN
DELETE FROM `product_categories`
########
## mySQL
alias mysql2d='mysqld_safe --defaults-file=/etc/my2.cnf &'
alias mysql2='mysql --defaults-file=/etc/my2.cnf'
alias mysqld1='mysqld_safe --defaults-file=/etc/my.cnf &'
alias mysql1='mysql --defaults-file=/etc/my.cnf'
@BooneTeam
BooneTeam / my2.cnf
Created October 30, 2014 13:09
my2.cnf
[client]
user=<user>
password=<password>
host=localhost
port=3307
socket=/tmp/mysql2.sock
[mysqld]
port=3307
datadir=/usr/local/var/mysql
@BooneTeam
BooneTeam / my1.cnf
Created October 30, 2014 13:07
my.cnf
[client]
user = <user>
password = <password>
host = localhost
port=3306
socket=/Applications/MAMP/tmp/mysql/mysql.sock
[mysqld]
datadir=/Applications/MAMP/db/mysql
port=3306
@BooneTeam
BooneTeam / app.js
Created July 2, 2014 19:12
app.js for Fyns
var express = require('express');
var path = require('path');
var favicon = require('static-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var needle = require('needle');
var routes = require('./routes/index');
var users = require('./routes/users');
@BooneTeam
BooneTeam / NewEntryDupTest.rb
Created July 16, 2013 19:57
This tests for duplicate entries and suggests a name with the next greatest number attached to the end. It then prompts the user to enter a new one or say yes to the one suggested.
module NewEntryDupTest
attr_accessor :entry, :old_entries
# def initialize(*args)
# @old_entries ||= []
# @entry = :entries
# end
@@old_entries = ['Homer']