This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######## | |
## 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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[client] | |
user=<user> | |
password=<password> | |
host=localhost | |
port=3307 | |
socket=/tmp/mysql2.sock | |
[mysqld] | |
port=3307 | |
datadir=/usr/local/var/mysql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[client] | |
user = <user> | |
password = <password> | |
host = localhost | |
port=3306 | |
socket=/Applications/MAMP/tmp/mysql/mysql.sock | |
[mysqld] | |
datadir=/Applications/MAMP/db/mysql | |
port=3306 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module NewEntryDupTest | |
attr_accessor :entry, :old_entries | |
# def initialize(*args) | |
# @old_entries ||= [] | |
# @entry = :entries | |
# end | |
@@old_entries = ['Homer'] |
NewerOlder