Skip to content

Instantly share code, notes, and snippets.

@BooneTeam
BooneTeam / github.js
Last active December 19, 2015 13:19
Github Functionality for DBConnect This Allows a user to drag their top five Github repositories urls and display them.
repos = [];
$(document).ready(function(){
$('#git_error').hide();
$.each($( "#github_list_showing tr td"),function(index,value){
repos.push($(value).data());
});
$( ".all_repos tr" ).draggable({helper: 'clone'});
$( "#github_list_showing" ).droppable({
@BooneTeam
BooneTeam / grades_and_sort.rb
Created July 10, 2013 23:08
Calculates grades and can sort students based on any field.
Struct.new("Student", :scores, :first_name, :last_name, :ssn)
class AverageScores
attr_accessor :scores
def initialize(scores)
@scores = scores
end
@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']
@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 / 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 / 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
########
## 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 / 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`
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;
// 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) {